|
网址0000qj.com
验证码我已经解决了,但是不知道为什么我模拟登陆老是提示验证码输入失败。
{"msg":"输入验证码失败!","code":201,"data":null}
StringBuilder sbHtml = new StringBuilder("");
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse httpResp = null;
try
{
httpReq.Method = "POST";
httpReq.Headers.Add("X-Requested-With", "XMLHttpRequest");
httpReq.Accept = "application/json, text/javascript, */*; q=0.01";
httpReq.Referer = "http://0000qj.com/";
httpReq.Headers.Add("Accept-Language", "zh-cn");
httpReq.Headers.Add("Accept-Encoding", "gzip, deflate");
httpReq.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)";
httpReq.Host = "0000qj.com";
httpReq.ContentLength = 0;
httpReq.Headers.Add("Pragma", "no-cache");
httpReq.ContentType = "application/json";
httpResp = (HttpWebResponse)httpReq.GetResponse();
sbHtml.Append(new StreamReader(httpResp.GetResponseStream(), Encoding.UTF8).ReadToEnd());
} |
|