/// <summary> /// GET方式发送得结果 /// </summary> /// <param name="url">请求的url</param> public static string DoGetRequestSendData(string url) { HttpWebRequest hwRequest = null; HttpWebResponse hwResponse = null; string strResult = string.Empty; try { hwRequest = (System.Net.HttpWebRequest)WebRequest.Create(url); //hwRequest.Timeout = 30000; hwRequest.Method = "GET"; hwRequest.ContentType = "application/x-www-form-urlencoded"; } catch (System.Exception err) { } try { hwResponse = (HttpWebResponse)hwRequest.GetResponse(); StreamReader srReader = new StreamReader(hwResponse.GetResponseStream(), Encoding.ASCII); strResult = srReader.ReadToEnd(); srReader.Close(); hwResponse.Close(); } catch (System.Exception err) { } return strResult; } ———————————————— 版权声明:本文为CSDN博主「仅此而已丶」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/qq_32343577/article/details/81240709