需要用到winapi
[DllImport(“wininet.dll”, CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool InternetSetCookie(string lpszUrlName, string lbszCookieName, string lpszCookieData);
第一个参数是cookie针对的域名
InternetSetCookie(“www.qq.com”, “userid”, “10000”);