using ;
using ;
public string get_html()
{
string urlStr = ""; //Set the address to be obtained
HttpWebRequest hwr = (HttpWebRequest)(urlStr); //Create the HttpWebRequest object
= 60000; //Define server timeout
WebProxy proxy = new WebProxy(); //Define a network object
= new Uri(":3128"); //Network server: port
= new NetworkCredential("f3210316", "6978233"); //User name, password
= true; //Enable network relevance verification
= proxy; //Set the network
try
{
HttpWebResponse hwrs = (HttpWebResponse)(); //Get Response
}
catch
{
("Proxy cannot be connected!");
return;
}
//Judge HTTP response status
if( != )
{
("Access failed!");
();
return;
}
else
{
Stream s = (); //The stream object that gets the response
StreamReader sr = new StreamReader(s, Encoding.UTF8); //Read the stream with UTF-8 code
StringBuilder content = new StringBuilder(); //
while (() != -1) //Read one line every time until
{ //The next word has no content
(()+""r"n"); //Return until
} //
//return () ;
}
//Output all headers (including the cookies output by the server of course)
//for(int ii=0;ii<;ii++)
//{
//((ii)+":"+[ii]);
//}
}