首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏c#Winform自定义控件系列

    c# HttpWebRequest 解决 请求HTTPS慢

    { request.Credentials = CredentialCache.DefaultCredentials; ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); ServicePointManager.SecurityProtocol SecurityProtocolType.Tls12; request.ProtocolVersion = HttpVersion.Version11; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.Expect100Continue

    1.4K20发布于 2021-11-19
  • 来自专栏用户1031264的专栏

    c# Https Post Get

    ) { request = WebRequest.Create(url) as HttpWebRequest; ServicePointManager.ServerCertificateValidationCallback ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | (SecurityProtocolType = true; ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.Expect100Continue ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | (SecurityProtocolType = true; ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.Expect100Continue

    1.4K10编辑于 2022-05-27
  • 来自专栏Windows技术交流

    当执行Install-Module命令时报错:找不到与指定的搜索条件和程序包名称匹配的项目,请尝试使用Get-PSRepository查看所有可用的注册程序包源

    null(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release[System.Net.ServicePointManager ([Net.SecurityProtocolType]::Tls12)) -eq $false){[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager ]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType ]::Tls12}[System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12

    2.3K10编辑于 2024-02-02
  • 来自专栏Windows技术交流

    powershell启用tls1.2

    Net.SecurityProtocolType]) [Enum]::GetNames([Net.SecurityProtocolType]) -contains 'Tls12' [System.Net.ServicePointManager ]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12) 主要是看这句命令执行结果是不是True [System.Net.ServicePointManager [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType ]::Tls12 或 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 或 [System.Net.ServicePointManager ::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 然后再在当前窗口再次执行上述检查tls1.2的命令 [System.Net.ServicePointManager

    2.2K30编辑于 2024-04-29
  • 来自专栏Windows技术交流

    【Install-Module : 需要使用 NuGet 提供程序来与基于 NuGet 的存储库交互。请确保已安装 NuGet 提供程序或更高版本。】

    ([Net.SecurityProtocolType]::Tls12)临时解决办法执行以下3选1命令,仅对当前窗口有效[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12[Net.ServicePointManager ([Net.SecurityProtocolType]::Tls12)) -eq $false){[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager ]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12[Net.ServicePointManager]::SecurityProtocol ]::Tls12}[System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12

    2.1K10编辑于 2023-11-24
  • 来自专栏Windows技术交流

    合并相同表结构的多个Excel文件(.csv、.xlsx)

    替换下目录路径为自己的) Set-executionpolicy -ExecutionPolicy Unrestricted -Scope CurrentUser -Force; [System.Net.ServicePointManager ]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12) if(([System.Net.ServicePointManager]: :SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)) -eq $false){ [Net.ServicePointManager]: :SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [System.Net.ServicePointManager

    3.3K10编辑于 2024-05-03
  • 来自专栏全栈文档库

    HTTP请求PowerAutomate错误:”基础连接已关闭,发送时发生错误”

    = true; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;//这里设置了协议类型 ServicePointManager.ServerCertificateValidationCallback = true; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;//这里设置了协议类型 ServicePointManager.ServerCertificateValidationCallback SecurityProtocolType能够点出来的属性就可以):*/ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

    2.9K10编辑于 2024-02-03
  • 来自专栏Windows技术交流

    静默安装dotnet4.8和4.8.1

    ]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12) if(([System.Net.ServicePointManager]: :SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)) -eq $false){ [Net.ServicePointManager]: :SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 } [System.Net.ServicePointManager]::SecurityProtocol.HasFlag

    1.5K10编辑于 2025-07-15
  • 来自专栏技术文章

    C# 关于“您与该网站的连接不是私密连接...”的问题

    ,bool secValid=true) { method = method.ToUpper(); if (secValid == false) { ServicePointManager.ServerCertificateValidationCallback = validSecurity; } System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls 该方法应用于 ServicePointManager.ServerCertificateValidationCallback,该属性是一个委托属性,它允许你指定一个回调方法,当需要验证服务器SSL证书时 关于 System.Net.ServicePointManager.SecurityProtocol 的更多介绍请访问如下链接: https://learn.microsoft.com/zh-cn/dotnet E6%9C%8D%E5%8A%A1%E5%99%A8%E5%8D%87%E7%BA%A7%E5%88%B0-net-framework-4-6-%E5%90%8E%E4%BD%BF%E7%94%A8-servicepointmanager

    75810编辑于 2024-09-25
  • 来自专栏Windows技术交流

    The request was aborted: Could not create SSL/TLS secure channel.

    invoke-webrequest "http://www.7-zip.org/a/7z1900-x64.msi" -outfile "c:\7z1900.msi" 【临时办法】 powershell执行 [Net.ServicePointManager Net.SecurityProtocolType]::Tls12 【彻底办法】 通过注册表实现,将以下代码另存为tls1.2_on.reg,双击点“是”导入后,再打开powershell执行[Net.ServicePointManager invoke-webrequest "http://www.7-zip.org/a/7z1900-x64.msi" -outfile "c:\7z1900.msi" server 2016 powershell运行 [Net.ServicePointManager Use the following command to ensure you are using TLS 1.2: [Net.ServicePointManager]::SecurityProtocol powershell里执行[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12只是临时办法,关闭

    3.1K40发布于 2021-10-08
  • 来自专栏Windows技术交流

    公有云Windows Docker踩坑详述

    4、安装docker注意事项 2016 powershell运行 [Net.ServicePointManager]::SecurityProtocol 查看没有Tls12 目前Tls12(tls1.2 Use the following command to ensure you are using TLS 1.2: [Net.ServicePointManager]::SecurityProtocol ]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12) 不是的话,临时启用tls1.2 [Net.ServicePointManager ]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 的命令 [System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12) 5、解决了

    7.4K162编辑于 2024-03-25
  • 来自专栏AhDung

    【手记】解决“未能创建 SSL/TLS 安全通道”异常

    具体就是在发起网络请求之前确保ServicePointManager.SecurityProtocol中含有服务端所用的安全协议,如果不知道或希望客户端健壮一点,当然最简单的方式就是把所有可用的协议都启用 代码如下: ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 SecurityProtocolType.Tls12; 但如果客户端是基于.net framework 4.0或更早版本的,SecurityProtocolType枚举中并没有Tls11和Tls12,这就需要直接填值: ServicePointManager.SecurityProtocol 事实上,这个问题正是因为我的客户端是基于.net 4.0的,而4.0的ServicePointManager.SecurityProtocol默认就不含Tls11和Tls12,所以当服务端改用这两种安全协议时

    7.2K20发布于 2019-03-15
  • 来自专栏DotNet NB && CloudNative

    C# 中HttpWebRequest发起HTTP请求,如何设置才能达到最大并发和性能

    前言 在C#中使用HttpWebRequest发起HTTP请求时,达到最大并发和性能可以从以下几个方面改进: 1、ServicePointManager设置 ServicePointManager 类是一个静态类 为了提升并发性能,你需要调整以下几个关键属性: DefaultConnectionLimit: 默认情况下,.NET Framework的ServicePointManager限制了对同一域名的并发连接数 ServicePointManager.DefaultConnectionLimit = 100; // 一个合适的值,例如100 Expect100Continue: 当你发送一个POST请求时,.NET ServicePointManager.ReusePort = true; 2、异步编程模型 使用HttpWebRequest的异步方法,如BeginGetResponse和EndGetResponse 注意事项 1、设置ServicePointManager.DefaultConnectionLimit过高可能会导致服务器压力增大,甚至拒绝服务,应根据实际情况谨慎设置。

    2.8K10编辑于 2023-12-13
  • windows nodejs 安装超快超简单的方式,不用配置环境变量

    方法一Chocolatey 安装第一步安装 Chocolatey CLISet-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object

    1.3K10编辑于 2024-03-12
  • 来自专栏c#Winform自定义控件系列

    c# 查询本机可用的代理ip

    request.AllowAutoRedirect = blnAllowAutoRedirect; if (blnHttps) { ServicePointManager.ServerCertificateValidationCallback CheckValidationResult); request.ProtocolVersion = HttpVersion.Version10; ServicePointManager.SecurityProtocol CheckValidationResult); request.ProtocolVersion = HttpVersion.Version10; ServicePointManager.SecurityProtocol = strAccept; } if (blnHttps) { ServicePointManager.ServerCertificateValidationCallback CheckValidationResult); request.ProtocolVersion = HttpVersion.Version10; ServicePointManager.SecurityProtocol

    1.4K20发布于 2019-09-10
  • 来自专栏做不甩锅的后端

    在windows上通过choco安装superbenchmarker进行压测

    在windows中用管理员身份运行Powershell,之后执行如下代码: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object

    1K20发布于 2021-08-12
  • 来自专栏技术文章

    C# 解决“因为算法不同,客户端和服务器无法通信”的问题

    开发运行环境 操作系统: Windows Server 2019 DataCenter .net版本: .netFramework4.7.2 开发工具:VS2019 C# 解决 System.Net.ServicePointManager.SecurityProtocol 可能是由于协议版本不匹配造成的此原因,通过在Page_Load 服务器事件添加如下语句,问题解决: void Page_Load(Object sender, EventArgs e) { System.Net.ServicePointManager.SecurityProtocol PostXmlAndCertToUrl(string url, string postData,string cert,string password) { string resp = string.Empty; ServicePointManager.ServerCertificateValidationCallback

    79310编辑于 2024-12-28
  • 来自专栏技术文章

    C# 解决访问 API 显示基础连接已经关闭的问题

    VS2019 C# 解决 通过在Page_Load 服务器事件添加如下语句,解决: void Page_Load(Object sender, EventArgs e) { System.Net.ServicePointManager.SecurityProtocol | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12; } System.Net.ServicePointManager.SecurityProtocol 更多详情请参考: https://learn.microsoft.com/zh-cn/dotnet/api/system.net.servicepointmanager.securityprotocol

    73610编辑于 2024-12-17
  • 来自专栏崔哥的专栏

    Windows下的包管理器Chocolatey

    Set-ExecutionPolicy unrestricted PS C:\Users\work> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object

    84210编辑于 2022-05-25
  • 来自专栏云深之无迹

    安装Chocolatey

    现在运行以下命令: 复制Set-ExecutionPolicy绕过-Scope Process -Force; [System.Net.ServicePointManager] :: SecurityProtocol = [System.Net.ServicePointManager] :: SecurityProtocol -bor 3072; iex(((新对象System.Net.WebClient).DownloadString

    89630发布于 2020-11-03
领券