xuemykisskui
      ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
                X509Certificate cer = new X509Certificate(cert, password,X509KeyStorageFlags.PersistKeySet|X509KeyStorageFlags.Exportable|X509KeyStorageFlags.MachineKeySet);
                HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url);
                webrequest.ClientCertificates.Add(cer);
                webrequest.Method = "post";
                webrequest.Proxy = null;
                Encoding encoding = Encoding.UTF8;
                    byte[] databyte = encoding.GetBytes(xml);
                    webrequest.ContentLength = databyte.Length;
                    Stream stream = webrequest.GetRequestStream();
                    stream.Write(databyte, 0, databyte.Length);
                    stream.Close();
                    string result = string.Empty;
                   webrequest.KeepAlive = false;
                   HttpWebResponse webreponse = (HttpWebResponse)webrequest.GetResponse();
                   Stream responsestream = webreponse.GetResponseStream();
                   using (StreamReader reader = new StreamReader(responsestream))
               {
                   result = reader.ReadToEnd();
                   writeLogs.writelog("退款接口返回结果:" + result);
               }

  

分类:

技术点:

相关文章:

  • 2022-02-23
  • 2022-01-28
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2022-02-15
  • 2021-05-17
  • 2021-11-27
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案