/// <summary>
/// 发起一个HTTP请求(以GET方式)
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public string HttpGet(string url)
{
WebRequest myWebRequest = WebRequest.Create(url);
WebResponse myWebResponse = myWebRequest.GetResponse();
Stream ReceiveStream = myWebResponse.GetResponseStream();
string responseStr = "";
if (ReceiveStream != null)
{
StreamReader reader = new StreamReader(ReceiveStream, Encoding.UTF8);
responseStr = reader.ReadToEnd();
reader.Close();
}
myWebResponse.Close();
return responseStr;
}