private void button1_Click( object sender , EventArgs e)
{
HttpWebRequest request = ( HttpWebRequest ) WebRequest . Create(
"http://community.csdn.net/Index.htm" );
request . MaximumAutomaticRedirections = 4 ;
request . MaximumResponseHeadersLength = 4 ;
request . Credentials = CredentialCache . DefaultCredentials;
HttpWebResponse response = ( HttpWebResponse )request . GetResponse();
Console . WriteLine( "Content length is {0}" , response . ContentLength);
Console . WriteLine( "Content type is {0}" , response . ContentType);
response . Close();
}