• 2024-02-22C# 采用HttpWebRequest 、WebClient和HttpClient下载https的文件异常问题
    今天有个客户反应,程序下载文件失败,无法正常使用。远程客户电脑后,查看错误日志,都是提示https:****************************.dll等一系列文件的下载错误提示提示基础连接已经关闭:发送时发生错误。在网上找了很多方案都没有能解决,大多都是https链接时增加指定协议,很遗憾未能解
  • 2023-09-20后端发送Post请求
    publicstaticstringDoPostByADK(stringurl,stringjsonData,stringtoken){//发送Post请求try{ServicePointManager.ServerCertificateValidationCallback=newSystem.Net.Security.RemoteCertificateValidationCallback(Ch
  • 2023-08-28post data http or https
    classProgramTest{staticvoidMain(string[]args){stringurl="https://www.test.com";stringresult=PostUrl(url,"key=123");//key=4da4193e-384b-44d8-8a7f-2dd8b076d784Con
  • 2023-05-10解决“未能创建 SSL/TLS 安全通道”异常
    ServicePointManager.SecurityProtocol=SecurityProtocolType.Ssl3|SecurityProtocolType.Tls|SecurityProtocolType.Tls11|SecurityProtoco
  • 2023-05-10https安全协议C#
    ServicePointManager.SecurityProtocol=(SecurityProtocolType)48|(SecurityProtocolType)192|(SecurityProtocolType)768|(SecurityProtocolType)3072;ServicePointManager.Expect100Continue=true;ServicePointManager.ServerCertificat
  • 2023-04-21c# request
    1、基础连接已经关闭:处理:request.Abort();response.Close();System.GC.Collect();request.ProtocolVersion=HttpVersion.Version10;2、操作超时:处理:System.Net.ServicePointManager.DefaultConnectionLimit=200;//增加并发连接数(有的也不管用)
  • 2023-01-17GET/POST后台请求性能优化
     publicstaticstringDoGET(stringposturl,Hashtablevalues=null){Streaminstream=null;StreamReadersr=null;
  • 2022-12-29C#:https文件下载
    今天在.net4.5环境下用WebClient下载https的文件时,报错: 基础连接已经关闭:发送时发生错误。加上ServicePointManager.SecurityProtocol=SecurityProtocolType.Tls12;
  • 2022-12-15C# 解决“请求被中止: 未能创建 SSL/TLS 安全通道”的问题
    解决办法:让客户端启用该协议。具体就是在发起网络请求之前确保ServicePointManager.SecurityProtocol中含有服务端所用的安全协议,如果不知道或希望客户端健壮一点,当然最简
  • 2022-11-18C# 对于 SSL/TLS 的安全通信问题
    C#对于SSL/TLS的安全通信问题1、请求被中止:未能创建SSL/TLS安全通道ServicePointManager.SecurityProtocol=SecurityProtocolType.Tls12;注:SecurityProtocolT
  • 2022-10-29choco报错
    choco:无法将“choco”项识别为cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。原因:没有安装chocolatey:cho
  • 2022-10-17HttpWebRequest 请求被中止: 未能创建 SSL/TLS 安全通道
    在HttpWebRequest前设置代码ServicePointManager.Expect100Continue=true;ServicePointManager.SecurityProtocol=SecurityProtocolType.Tls12|SecurityProtocolTy