-2
私は特定のウェブサイトからすべてのクッキーを取得するアプリケーションを作成しています。何らかの理由でウェブサイトからすべてのクッキーを取得できない場合、この問題は修正可能ですか?C#ウェブサイトからすべてのクッキーを取得できません
listBox1.Items.Clear();
try
{
string url = textBox1.Text;
HttpWebRequest myCall = (HttpWebRequest)WebRequest.Create(url);
myCall.CookieContainer = new CookieContainer();
response = (HttpWebResponse)myCall.GetResponse();
myCall.AllowAutoRedirect = true;
foreach (Cookie cookie in response.Cookies)
{
listBox1.Items.Add(cookie.Name);
listBox1.Items.Add(cookie.Value);
}
myCall.Abort();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
HTTP応答と戻ってくる値を表示してください。 –