日期:2014-05-20 浏览次数:21130 次
public static void Main()
{
// Create a request for the URL.
WebRequest request = WebRequest.Create(@"http://www.163.com");
// If required by the server, set the credentials.
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();//此处查看response的CharacterSet属性,为CharacterSet = "ISO-8859-1",而直接查看网页的源文件为<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
}