0
我想登錄到一個網站,通過Windows Phone 7應用程序發送短信。我有2個提供商工作,但當我嘗試沃達豐我遇到了一個錯誤。網站不返回餅乾
從我收集的內容看來,響應似乎不包含cookie,或者它們沒有被讀取。請求登錄成功,我返回的響應是正確的頁面,但不包含cookie。
的網址:
RequestUrl = String.Format("https://www.vodafone.ie/myv/services/login/Login.shtml?username={0}&password={1}", userSettings.Username, userSettings.Password),
的請求:
Request = (HttpWebRequest)WebRequest.Create((requestCollection.CurrentRequest().RequestUrl));
if (Request.CookieContainer == null)
{
Request.CookieContainer = cookieJar.CookieContainer;
Request.AllowAutoRedirect = true;
Request.AllowReadStreamBuffering = true;
Request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6";
}
當代碼中的錯誤作爲響應cookie無法評價:
public void AddCookiesToContainer(HttpWebResponse response)
{
CookieCollection.Add(response.Cookies);
CookieContainer.Add(response.ResponseUri, CookieCollection);
}
及以下的調試器顯示沒有餅乾:(
沒有人有任何建議嗎? :( – deanvmc 2010-12-07 16:35:56
CookieCollection = new CookieCollection(); – deanvmc 2010-12-07 18:35:34