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!");
        }

 

posted @ 2016-07-29 11:22  糖豆爸爸  阅读(674)  评论(0编辑  收藏  举报
Live2D