hi,
thanks for the example which works a treat.
i have a question, the line below is part of the UploadData function:
Encoding.UTF8.GetBytes("username=XXX&password=YYY" )
for my website will i use "username" and "password" or some other
variants? what exactly do "username" and "password" correspond to?
are they the values stored in the cookie, are they the id's for the
textboxes on the page (they dont seem to be)???
thanks again.
"Herfried K. Wagner [MVP]" wrote:
"taz" <ta*@discussions.microsoft.comschrieb:
i am trying to use HttpWebRequest to get the HTML of a webpage on a site.
problem is that the page is hidden behind a username-password login screen
which sets a cookie when the user has successfully logged. so, how can i
get
the HTML of the required page via HttpWebRequest ? ive tried using
CookieContainer and SetCookies but im not sure im using them properly.
Take a look at the two code samples:
<URL:http://dotnet.mvps.org/dotnet/code/net/#CookieRequest>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>