views:

48

answers:

1

i want to login the site bakcell.com/en/login and do something with the same session, but when i try this code i get this error:The remote server returned an error: (401) Unauthorized.

code:

HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://bakcell.com/en/login");
HttpWebResponse rs = (HttpWebResponse)wr.GetResponse();
Stream s = rs.GetResponseStream();
StreamReader srt = new StreamReader(s);
receiveData = srt.ReadToEnd(); 

But when i open this url from any web browser it works normal so how can i request as Web Browser to get body specified with this url?

A: 

Have you tried changing your user agent to something standard, like Mozilla/5.0 ?

Reinderien
yeah, i have tried but it responses with the same result
hers19