[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
 public static extern bool InternetSetCookie(string lpszUrlName, string lbszCookieName, string lpszCookieData);
InternetSetCookie("http://"+url, null, cookie);
//屏蔽webBrowser中的脚本错误
webBrowser1.ScriptErrorsSuppressed = true;
 webBrowser1.Navigate(url);

注意:不能直接用InternetSetCookie(url,null,cookie)这里的url一定要带:http://,调试中要注意查看区分。我就是这里没有注意花了很长时间才解决!!

相关文章:

  • 2021-08-20
  • 2021-10-23
  • 2021-05-14
  • 2022-02-27
  • 2021-11-14
  • 2022-12-23
  • 2021-04-03
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-02-27
相关资源
相似解决方案