CryptoConfig.AddAlgorithm(Type, String[]) 方法

定义

将一组名称添加到要用于当前应用程序域的算法映射。

public:
 static void AddAlgorithm(Type ^ algorithm, ... cli::array <System::String ^> ^ names);
public static void AddAlgorithm (Type algorithm, params string[] names);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static void AddAlgorithm (Type algorithm, params string[] names);
[System.Security.SecurityCritical]
public static void AddAlgorithm (Type algorithm, params string[] names);
static member AddAlgorithm : Type * string[] -> unit
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member AddAlgorithm : Type * string[] -> unit
[<System.Security.SecurityCritical>]
static member AddAlgorithm : Type * string[] -> unit
Public Shared Sub AddAlgorithm (algorithm As Type, ParamArray names As String())

参数

algorithm
Type

要映射到的算法。

names
String[]

要映射到该算法的名称的数组。

属性

例外

algorithmnames 参数为 null

algorithm 不能从该程序集外部访问。

  • 或 - names 参数中的一个条目是空的或为 null

注解

指定的映射优先于内置映射和machine.config文件中的映射。 映射用于防止部分信任代码使用受信任的加密操作。

适用于