Я использовал этот код для входа с c #
string formUrl = "http://sympatia.onet.pl/login.html"; // NOTE: This is the URL the form POSTs to, not the URL of the form (you can find this in the "action" attribute of the HTML's form tag
string formParams = "login=###&pass=###&ref=http%3A%2F%2Fsympatia.onet.pl%2Fout.html&logowanie=1";
HttpWebRequest req = WebRequest.Create(formUrl) as HttpWebRequest;
req.ContentType = "application/x-www-form-urlencoded";
req.Method = "POST";
req.Headers.Add(HttpRequestHeader.Cookie, "__utma=231467805.1578371583.1328737365.1328737365.1328740655.2; __utmc=231467805; __utmz=231467805.1328737365.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); onet_GUID_ac10=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; onet_ubi=201202082242463576130063; onetzuo_ticket=6DA3771FD1359AA572FA864BAED561310100618BD0B2A5B9912A75C7263BCF6E3283000000000000000059E4AEF9000000; onet_cid=b9fdca9e384502c8e296dc6236622aa2; onet_sid=13a0fa6e805a703b6c28dd43b812d6e9; onet_ubi=201202082242463576130063; onet_cid=b9fdca9e384502c8e296dc6236622aa2; onet_cst=e959770f7faffa5aaacfd18efda6bbab; onet_sid=13a0fa6e805a703b6c28dd43b812d6e9; symplogin=sid%3Df072b6e3d0dca623ce1qxyfkqklsvosk%26z%3D2011-11-29+21%3A01%3A58%26p%3DN%26l%3Dkoskow%26isClub%3D1%26isVip%3D0%26se%3DMezczyzna%26term%3D0%26sex%3Dm%26justLogged%3D1; landmarks=myaccount%2C; klex_sound=true; __utmb=231467805.11.10.1328740655");
req.UserAgent= "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1";
req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
req.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
req.Headers.Add(HttpRequestHeader.AcceptCharset, "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
req.Referer = "http://sympatia.onet.pl/login.html";
byte[] bytes = Encoding.ASCII.GetBytes(formParams);
req.ContentLength = bytes.Length;
using (Stream os = req.GetRequestStream())
{
os.Write(bytes, 0, bytes.Length);
}
, но он перенаправляет меня на страницу входа. Я пытался войти с веб-браузера и из приложения c #, и здесь сравнение в fiddler
из Visual Studio
POST http://sympatia.onet.pl/login.html HTTP/1.1
Host: sympatia.onet.pl
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://sympatia.onet.pl/login.html
Cookie: __utma=231467805.1578371583.1328737365.1328737365.1328740655.2; __utmc=231467805; __utmz=231467805.1328737365.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); onet_GUID_ac10=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; onet_ubi=201202082242463576130063; onetzuo_ticket=6DA3771FD1359AA572FA864BAED561310100618BD0B2A5B9912A75C7263BCF6E3283000000000000000059E4AEF9000000; onet_cid=b9fdca9e384502c8e296dc6236622aa2; onet_sid=13a0fa6e805a703b6c28dd43b812d6e9; onet_ubi=201202082242463576130063; onet_cid=b9fdca9e384502c8e296dc6236622aa2; onet_cst=e959770f7faffa5aaacfd18efda6bbab; onet_sid=13a0fa6e805a703b6c28dd43b812d6e9; symplogin=sid%3Df072b6e3d0dca623ce1qxyfkqklsvosk%26z%3D2011-11-29+21%3A01%3A58%26p%3DN%26l%3Dkoskow%26isClub%3D1%26isVip%3D0%26se%3DMezczyzna%26term%3D0%26sex%3Dm%26justLogged%3D1; landmarks=myaccount%2C; klex_sound=true; __utmb=231467805.17.10.1328740655
X-ClickOnceSupport: ( .NET CLR 3.5.30729; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Content-Length: 81
login=###&pass=###&ref=http%3A%2F%2Fsympatia.onet.pl%2Fout.html&logowanie=1
здесь из веб-браузера
POST http://sympatia.onet.pl/login.html HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: __utma=231467805.1578371583.1328737365.1328737365.1328740655.2; __utmc=231467805; __utmz=231467805.1328737365.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); onet_GUID_ac10=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; onet_ubi=201202082242463576130063; onetzuo_ticket=6DA3771FD1359AA572FA864BAED561310100618BD0B2A5B9912A75C7263BCF6E3283000000000000000059E4AEF9000000; onet_cid=b9fdca9e384502c8e296dc6236622aa2; onet_sid=13a0fa6e805a703b6c28dd43b812d6e9; onet_ubi=201202082242463576130063; onet_cid=b9fdca9e384502c8e296dc6236622aa2; onet_cst=e959770f7faffa5aaacfd18efda6bbab; onet_sid=13a0fa6e805a703b6c28dd43b812d6e9; symplogin=sid%3Df072b6e3d0dca623ce1qxyfkqklsvosk%26z%3D2011-11-29+21%3A01%3A58%26p%3DN%26l%3Dkoskow%26isClub%3D1%26isVip%3D0%26se%3DMezczyzna%26term%3D0%26sex%3Dm%26justLogged%3D1; landmarks=myaccount%2C; klex_sound=true; __utmb=231467805.11.10.1328740655
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Referer: http://sympatia.onet.pl/login.html
Host: sympatia.onet.pl
Content-Length: 81
Expect: 100-continue
Connection: Keep-Alive
login=###&pass=###&ref=http%3A%2F%2Fsympatia.onet.pl%2Fout.html&logowanie=1
из веб-браузера работает с C # не, какая помощь?