RandomNumberGenerator.Create 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立密碼編譯亂數產生器之實作的執行個體。
Create() |
建立預設之密碼編譯亂數產生器實作的執行個體,此產生器可以用來產生隨機資料。 |
Create(String) |
已淘汰.
建立指定之密碼編譯亂數產生器實作的執行個體。 |
建立預設之密碼編譯亂數產生器實作的執行個體,此產生器可以用來產生隨機資料。
public:
static System::Security::Cryptography::RandomNumberGenerator ^ Create();
C#
public static System.Security.Cryptography.RandomNumberGenerator Create();
static member Create : unit -> System.Security.Cryptography.RandomNumberGenerator
Public Shared Function Create () As RandomNumberGenerator
傳回
密碼編譯亂數產生器的新執行個體。
另請參閱
適用於
.NET 9 及其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
警告
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
建立指定之密碼編譯亂數產生器實作的執行個體。
public:
static System::Security::Cryptography::RandomNumberGenerator ^ Create(System::String ^ rngName);
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.RandomNumberGenerator? Create(string rngName);
C#
[System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.RandomNumberGenerator? Create(string rngName);
C#
public static System.Security.Cryptography.RandomNumberGenerator Create(string rngName);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member Create : string -> System.Security.Cryptography.RandomNumberGenerator
[<System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : string -> System.Security.Cryptography.RandomNumberGenerator
static member Create : string -> System.Security.Cryptography.RandomNumberGenerator
Public Shared Function Create (rngName As String) As RandomNumberGenerator
參數
- rngName
- String
要使用的亂數產生器實作的名稱。
傳回
密碼編譯亂數產生器的新執行個體。
- 屬性
另請參閱
適用於
.NET 9 及其他版本
產品 | 版本 (已淘汰) |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6 (7, 8, 9) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |