历史天气预报采集
![](https://img2023.cnblogs.com/blog/1059450/202310/1059450-20231018143215924-1688214480.jpg)
public class AppHttp { /// <summary> /// GET请求与获取结果 /// </summary> public static string HttpGet(string Url) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); request.Method = "GET"; request.ContentType = "text/html;charset=UTF-8"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream myResponseStream = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.Default); string retString = myStreamReader.ReadToEnd(); myStreamReader.Close(); myResponseStream.Close(); return retString; } }