mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 18:51:28 +08:00
适配net10
This commit is contained in:
@@ -35,7 +35,7 @@ public static class PBKDF2Encryption
|
|||||||
var salt = new byte[saltSize];
|
var salt = new byte[saltSize];
|
||||||
rng.GetBytes(salt);
|
rng.GetBytes(salt);
|
||||||
#if NET10_0_OR_GREATER
|
#if NET10_0_OR_GREATER
|
||||||
var hash = Rfc2898DeriveBytes.Pbkdf2(Encoding.UTF8.GetBytes(text), salt, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
|
var hash = Rfc2898DeriveBytes.Pbkdf2(System.Text.Encoding.UTF8.GetBytes(text), salt, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
|
||||||
#else
|
#else
|
||||||
using var pbkdf2 = new Rfc2898DeriveBytes(text, salt, iterationCount, HashAlgorithmName.SHA256);
|
using var pbkdf2 = new Rfc2898DeriveBytes(text, salt, iterationCount, HashAlgorithmName.SHA256);
|
||||||
var hash = pbkdf2.GetBytes(derivedKeyLength);
|
var hash = pbkdf2.GetBytes(derivedKeyLength);
|
||||||
@@ -69,7 +69,7 @@ public static class PBKDF2Encryption
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if NET10_0_OR_GREATER
|
#if NET10_0_OR_GREATER
|
||||||
var computedHash = Rfc2898DeriveBytes.Pbkdf2(Encoding.UTF8.GetBytes(text), saltBytes, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
|
var computedHash = Rfc2898DeriveBytes.Pbkdf2(System.Text.Encoding.UTF8.GetBytes(text), saltBytes, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
|
||||||
#else
|
#else
|
||||||
using var pbkdf2 = new Rfc2898DeriveBytes(text, saltBytes, iterationCount, HashAlgorithmName.SHA256);
|
using var pbkdf2 = new Rfc2898DeriveBytes(text, saltBytes, iterationCount, HashAlgorithmName.SHA256);
|
||||||
var computedHash = pbkdf2.GetBytes(derivedKeyLength);
|
var computedHash = pbkdf2.GetBytes(derivedKeyLength);
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PluginVersion>10.11.76</PluginVersion>
|
<PluginVersion>10.11.77</PluginVersion>
|
||||||
<ProPluginVersion>10.11.76</ProPluginVersion>
|
<ProPluginVersion>10.11.77</ProPluginVersion>
|
||||||
<DefaultVersion>10.11.76</DefaultVersion>
|
<DefaultVersion>10.11.77</DefaultVersion>
|
||||||
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
||||||
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
||||||
<NET8Version>8.0.20</NET8Version>
|
<NET8Version>8.0.20</NET8Version>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||||
<PackageReference Include="xunit" Version="2.9.3" />
|
<PackageReference Include="xunit" Version="2.9.3" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
|
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@@ -12,6 +12,11 @@ using Microsoft.AspNetCore.Hosting;
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
#if NET10_0_OR_GREATER
|
||||||
|
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
|
#endif
|
||||||
using MQTTnet.AspNetCore;
|
using MQTTnet.AspNetCore;
|
||||||
|
|
||||||
using ThingsGateway.Foundation;
|
using ThingsGateway.Foundation;
|
||||||
|
@@ -42,7 +42,7 @@ public partial class MqttServer : BusinessBaseWithCacheIntervalScriptAll
|
|||||||
|
|
||||||
#if NET10_0_OR_GREATER
|
#if NET10_0_OR_GREATER
|
||||||
|
|
||||||
private IHost _webHost { get; set; }
|
private Microsoft.Extensions.Hosting.IHost _webHost { get; set; }
|
||||||
|
|
||||||
#else
|
#else
|
||||||
private IWebHost _webHost { get; set; }
|
private IWebHost _webHost { get; set; }
|
||||||
|
Reference in New Issue
Block a user