
26.05.2009, 20:41
|
|
Reservists Of Antichat - Level 6
Регистрация: 23.05.2008
Сообщений: 756
С нами:
9456866
Репутация:
979
|
|
Код:
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://my.mail.ru/cgi-bin/auth");
req.Method = "POST";
req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.7)";
// req.Headers.Add("Accept-Language", "ru");
req.ContentType = "application/x-www-form-urlencoded";
req.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
req.AllowAutoRedirect = false;
string SQuery = "page=http://my.mail.ru/&Login=" + slogin + "&Domain=" + sdom + "&Password=" + spasswd;
byte[] ByteArr = System.Text.Encoding.GetEncoding(1251).GetBytes(SQuery);
req.ContentLength = ByteArr.Length;
req.GetRequestStream().Write(ByteArr, 0, ByteArr.Length);
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
sCookies = res.Headers["Set-Cookie"];
if ((new StreamReader(res.GetResponseStream(), Encoding.GetEncoding(1251)).ReadToEnd().IndexOf("Проверьте правильность") > 0))
richTextBox1.Text = accs+" BAD";
else {
req = (HttpWebRequest)HttpWebRequest.Create("http://my.mail.ru/mail/" + slogin + "/friends/?popup_list=1");
req.AllowAutoRedirect = true;
req.Method = "GET";
req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.7)";
req.Headers.Add("Accept-Language", "ru");
req.Referer = "http://my.mail.ru/cgi-bin/auth";
req.ContentType = "application/x-www-form-urlencoded";
req.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
req.ContentType = "text/plain";
req.Headers.Add(HttpRequestHeader.Cookie, sCookies);
res = (HttpWebResponse)req.GetResponse();
StreamReader strr = new StreamReader(res.GetResponseStream(), Encoding.GetEncoding(0));
Что я делаю не так ? Пытаюсь авторизироваться на my.mail.ru,авторизация проходит,куки получаю.Пытаюсь перейти на другую страницу с этими куками, не выходит...
|
|
|