WINFORM写入COOKIE

  [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern bool InternetSetCookie(string lpszUrlName, string lbszCookieName, string lpszCookieData);

        private void button1_Click(object sender, EventArgs e)
        {
            var url = "http://n.eduyun.cn/index.php?r=portal/site/index";
            InternetSetCookie(url, "Token", "value=HuangHaiWriting; expires=Thu, 01-Jan-2020 00:00:01 GMT");
            System.Diagnostics.Process.Start("iexplore", url);
            MessageBox.Show("ok!");
        }
原文地址:https://www.cnblogs.com/littlehb/p/5717667.html