主页 > 编程资料 > C# >
发布时间:2015-09-26 作者:网络 阅读:181次

private string GetHTML(string url)
  {

   System.Net.WebClient client = new System.Net.WebClient();

   try
   {
    byte[] buf  = client.DownloadData(url);
   
    //message.Text = System.Text.Encoding.GetEncoding("GB2312").GetString(buf);
    return System.Text.Encoding.GetEncoding("GB2312").GetString(buf);

   }
   catch( Exception err)
   {
    message.Text = err.Message;
   }
   return null;
           
  } 


关键字词: