This commit is contained in:
2025-08-30 13:53:59 +08:00
parent cb4c3b2935
commit ed47497d8c
17 changed files with 116 additions and 18 deletions

View File

@@ -94,6 +94,9 @@
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\Newtonsoft.Json.dll</HintPath>
@@ -136,7 +139,9 @@
<Reference Include="System.Memory">
<HintPath>..\Lib\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.4.2.0.0.Fakes">
<HintPath>FakesAssemblies\System.Net.Http.4.2.0.0.Fakes.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
@@ -151,6 +156,26 @@
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Threading.Tasks.Extensions">
<HintPath>..\Lib\System.Threading.Tasks.Extensions.dll</HintPath>
@@ -355,6 +380,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<Fakes Include="Fakes\System.Net.Http.fakes" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>

View File

@@ -12,6 +12,7 @@ using System.Threading.Tasks;
using System.Web;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Infrastructure.Exceptions;
using Org.BouncyCastle.Asn1.Ocsp;
namespace MyCode.Project.Infrastructure.WebPost
{
@@ -531,12 +532,18 @@ namespace MyCode.Project.Infrastructure.WebPost
/// <returns></returns>
public string DoPostJson(string url, string jsonData)
{
// 在应用程序启动时设置如Main方法或Application_Start
System.Net.ServicePointManager.SecurityProtocol =
SecurityProtocolType.Tls12;
string result = "";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.Timeout = 60*1000;//设置请求超时时间,单位为毫秒
req.ContentType = "application/json";
req.ProtocolVersion = HttpVersion.Version11;
req.ServicePoint.Expect100Continue = true;
//req.ServicePoint.SecurityProtocol = SecurityProtocolType.Tls12;
byte[] data = Encoding.UTF8.GetBytes(jsonData);
req.ContentLength = data.Length;

View File

@@ -23,6 +23,10 @@
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup></configuration>

View File

@@ -14,9 +14,14 @@
<package id="System.Diagnostics.PerformanceCounter" version="4.5.0" targetFramework="net462" />
<package id="System.IO.Pipelines" version="4.5.1" targetFramework="net461" />
<package id="System.Memory" version="4.5.1" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net45" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
<package id="System.Threading.Channels" version="4.5.0" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.1" targetFramework="net461" />
<package id="ThoughtWorks.QRCode" version="1.1.0" targetFramework="net45" />