请求一个页面并返回页面内容(常用于页面发短信等)

 

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(“url”);
req.Method = "GET";
WebResponse wr = req.GetResponse();
StreamReader sr = new StreamReader(wr.GetResponseStream());
string reslt = sr.ReadToEnd();

你可能感兴趣的:(短信)