public static string getPageInfo(String url)
{
WebResponse wr_result = null;
StringBuilder txthtml = new StringBuilder();
try
{
WebRequest wr_req = WebRequest.Create(url);
wr_result = wr_req.GetResponse();
Stream ReceiveStream = wr_result.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("gb2312");
StreamReader sr = new StreamReader(ReceiveStream, encode);
if (true)
{
Char[] read = new Char[256];
int count = sr.Read(read, 0, 256);
while (count > 0)
{
String str = new String(read, 0, count);
txthtml.Append(str);
count = sr.Read(read, 0, 256);
}
}
}
catch (Exception)
{
txthtml.Append("err");
}
finally
{
if (wr_result != null)
{
wr_result.Close();
}
}
return txthtml.ToString();
}