哪位好心人帮忙救急!Cookie问题(没多少分了,见谅)

djcsdn 2006-10-28 08:36:47
在访问我的这个页面的时候,为什么下面的代码无法得到COOKIE?而我用FIREFOX浏览器访问的时候可以得到一个COOKIE?
//https://portal.faw-vw.com
myCookieContainer = new System.Net.CookieContainer();
ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
string DefaultUrl = "https://portal.faw-vw.com";
System.Net.HttpWebRequest myHttpWebRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(DefaultUrl);
myHttpWebRequest.AllowAutoRedirect = true;

myHttpWebRequest.CookieContainer = myCookieContainer;
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
System.Net.HttpWebResponse myHttpWebResponse = (System.Net.HttpWebResponse)myHttpWebRequest.GetResponse();
MessageBox.Show(myHttpWebResponse.Cookies.Count.ToString());
return;
...全文
130 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
股神 2006-10-28
  • 打赏
  • 举报
回复
up

110,825

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧