I have attached hotmail.cs to this post which is 20.1 kb. The fix was
in the last section. INstead of doing a post we are going to do a get
on the GetContacts page on hotmail. Please feel free to clean up the
code as needed.
I have hardcoded the GetCOntacts url with the n= value which seems to
be time generated random number. In my testing it worked all the time
so I have left it as a hardcoded value : ) . Again the entire
hotmail.cs file is attached to the group.
string strCSVUrl = "
http://by126w.bay126.mail.live.com/
mail/GetContacts.aspx?n=1967317953";
//
http://by112w.bay112.mail.live.com/mail/options.aspx?
subsection=26&n=938064379
//string strCSVUrl = strContactsCSV;
string strCSVUrl = "
http://by126w.bay126.mail.live.com/
mail/GetContacts.aspx?n=1967317953";
HttpWebRequest webReqCSVASPX =
(HttpWebRequest)WebRequest.Create(strCSVUrl);
string strCSVBody = strVIEWSTATE + "&" + strmt + "&" +
strExportButton + "&" + strEVENTVALIDATION;
webReqCSVASPX.Method = Utility.Get ;
webReqCSVASPX.UserAgent = Utility.UserAgent;
webReqCSVASPX.KeepAlive = true;
webReqCSVASPX.Referer = strExpContactsUrl;
webReqCSVASPX.AllowAutoRedirect = true;
webReqCSVASPX.ContentType = Utility.ContentTypeUrlEncoded;
webReqCSVASPX.UseDefaultCredentials = true;
webReqCSVASPX.CookieContainer = new CookieContainer();
webReqCSVASPX.CookieContainer.Add(ccWebResLogin);
webReqCSVASPX.CookieContainer.Add(ccWebResMailLiveComASPX);
webReqCSVASPX.CookieContainer.Add(ccWebResByBayASPX);
// StreamWriter sw4 = new
StreamWriter(webReqCSVASPX.GetRequestStream());
//sw4.Write(strCSVBody); sw4.Close();