2017-10-17 5 views
-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); 
     } 
+0

HTTP応答と戻ってくる値を表示してください。 –

答えて

0

ドメイン間のサイトからCookieを取得しようとしている可能性はありますか? Cookieは、同じドメイン内のサイト間でのみ共有できます。

関連する問題