WinFrom 写COOKIE
[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool InternetSetCookie(string lpszUrlName, string lbszCookieName, string lpszCookieData);
public static void SetCookie(string url, string Cookies, DateTime dt)
{
string cookieTime = ";expires=" + dt.ToString("r");
foreach (var v in Cookies.Split(';'))
{
InternetSetCookie(url, null, v + cookieTime);
}
}
//dt.ToString("r"); 返回GMT格式。。。