HttpWebRequest报错:用戶端和伺服器無法溝通,因為它們沒有公用的演算法
程序代码:
string strFormValues; string strNewValues; WedaData1.ReturnInput re = data.Web_GetPaypalConfig(ConfigurationManager.ConnectionStrings["wedaweb"].ConnectionString); string serverURL = re.entity.GetType().GetProperty("serverURL").GetValue(re.entity).ToString(); string pdtToken = re.entity.GetType().GetProperty("pdtToken").GetValue(re.entity).ToString(); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(serverURL); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; string txToken = Request.QueryString["tx"].ToString(); string query = "cmd=_notify-synch&tx=" + txToken + "&at=" + pdtToken; byte[] param = HttpContext.Current.Request.BinaryRead(HttpContext.Current.Request.ContentLength); strFormValues = Encoding.ASCII.GetString(param); strNewValues = strFormValues + query; req.ContentLength = strNewValues.Length; StreamWriter stout = new StreamWriter(req.GetRequestStream(), Encoding.ASCII); stout.Write(strNewValues); stout.Close(); StreamReader sr = new StreamReader(req.GetResponse().GetResponseStream()); string strResponse = sr.ReadToEnd(); sr.Close(); return strResponse;以上是我的代码,在req.GetRequestStream()这一行,报错:用戶端和伺服器無法溝通,因為它們沒有公用的演算法;
因为这是香港服务器,这个错误我也不知道什么意思,也不知道怎么解决,望大神们研究一下