在创建请求地址的前面加了这句代码就可以了:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
private string LoadURLString(string url, Encoding ed, string GetPost)
{
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create(url);
request1.Method = GetPost;
request1.ContentType = "application/json";
request1.Accept = "application/json";
return new StreamReader(((HttpWebResponse)request1.GetResponse()).GetResponseStream(), ed).ReadToEnd();
}