how can i snatch the html code within the id authentication?  
Author Message
Lin Liu Jian





PostPosted: Visual C# General, how can i snatch the html code within the id authentication? Top

some application can snatch the html code that the webserver returns,for example:

Uri myUri =new Uri(" http://www.hide-link.com/ ;);
HttpWebRequest request= (HttpWebRequest)WebRequest.Create(myUri);
HttpWebResponse webresponse= (HttpWebResponse)request.GetResponse();
StreamReader streamReader = new StreamReader(webresponse.GetResponseStream(),Encoding.GetEncoding("big5"));

but my question is :if i can get the code within my id authentication .(in origin the authentication info may be in the cookies or the session),for example.in campus,i want to check my info in school website,i must sign in first..i know the username and password, so i can get my information (namely the html code that theserver returns)with my .net programme but not the web explorer...

i am a beginner ,thanks for your help




Visual C#18  
 
 
Paul Louth





PostPosted: Visual C# General, how can i snatch the html code within the id authentication? Top

You need to make sure you're passing the cookies back on subsequent requests.


 
 
Lin Liu Jian





PostPosted: Visual C# General, how can i snatch the html code within the id authentication? Top

do u know how to implement ur idea

thanks,could u give some code sample



 
 
GavH





PostPosted: Visual C# General, how can i snatch the html code within the id authentication? Top

Take a look at HTTPWebRequest and HTTPWebResponse

http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.aspx

Those classes provide methods for communicating over HTTP, including obtaining cookies which need to be allowed explicitly by using CookieContainer.

Regards



 
 
Paul Louth





PostPosted: Visual C# General, how can i snatch the html code within the id authentication? Top

Here check this link:

http://www.codeproject.com/cs/internet/httpwebrequest_response.asp