CookieContainer cookies = new CookieContainer();
//验证码
public static Image doGetImg(CookieContainer bCookie)
{try
{
string url = "http://";//验证码网址
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url.ToString());
myRequest.ServicePoint.Expect100Continue = true;
myRequest.CookieContainer = bCookie;
myRequest.Method = "GET";
myRequest.Timeout = 30000;
myRequest.KeepAlive = true;
myRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36";
winform模拟登陆(带验证码)
最新推荐文章于 2023-09-12 09:37:34 发布