AssemblyLoadContext.LoadUnmanagedDll(String) AssemblyLoadContext.LoadUnmanagedDll(String) AssemblyLoadContext.LoadUnmanagedDll(String) AssemblyLoadContext.LoadUnmanagedDll(String) Method

定义

允许派生的类按名称加载非托管库。Allows derived class to load an unmanaged library by name.

protected:
 virtual IntPtr LoadUnmanagedDll(System::String ^ unmanagedDllName);
protected virtual IntPtr LoadUnmanagedDll (string unmanagedDllName);
abstract member LoadUnmanagedDll : string -> nativeint
override this.LoadUnmanagedDll : string -> nativeint
Protected Overridable Function LoadUnmanagedDll (unmanagedDllName As String) As IntPtr

参数

unmanagedDllName
String String String String

非托管库的名称。Name of the unmanaged library. 这通常是不带路径或扩展名的文件名。Typically this is the filename without its path or extensions.

返回

已加载库的句柄或为 nullA handle to the loaded library, or null.

注解

默认实现始终返回nullThe default implementation always return null. null返回,则在运行时加载的库使用其默认策略。When null is returned, the runtime loads the library with its default policy.

可以重写此虚拟方法,以自定义的非托管的库搜索算法。This virtual method can be overridden to customize the unmanaged library search algorithm. 在重写时可以使用名称来标识库。When overridden the name can be used to identify the library. 已加载的库不需要匹配所请求名称,但可以根据需要转换。The loaded library does not need to match the requested name, but can be transformed as needed. 这可能包括调整平台特定命名的名称。This could include adjusting the name for platform specific naming.

适用于