/**/ /// <summary> /// 下载URL指定网页 /// </summary> /// <param name="url">下载网页的URL</param> /// <param name="reff">来路URL</param> /// <returns></returns> static public string GetPage( string url, string reff) ... { HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); myHttpWebRequest.Referer = reff; HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); Stream receiveStream = myHttpWebResponse.GetResponseStream(); Encoding encode = System.Text.Encoding.Default; StreamReader readStream = new StreamReader(receiveStream, encode); Char[] read = new Char[1024]; int count = readStream.Read( read, 0, 1024 ); StringBuilder sb=new StringBuilder(); while (count > 0) ...{ String str = new String(read, 0, count); sb.Append(str); count = readStream.Read(read, 0, 1024); } myHttpWebResponse.Close(); readStream.Close(); return sb.ToString(); }