DllImportSearchPath 枚举
定义
指定用于搜索提供平台调用功能的 DLL 的路径。Specifies the paths that are used to search for DLLs that provide functions for platform invokes.
此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。
public enum class DllImportSearchPath
[System.Flags]
public enum DllImportSearchPath
type DllImportSearchPath =
Public Enum DllImportSearchPath
- 继承
- 属性
字段
ApplicationDirectory | 512 | 在 DLL 的搜索路径中包含了应用程序目录。Include the application directory in the DLL search path. |
AssemblyDirectory | 2 | 当搜索程序集依赖项时,请包括包含程序集本身的目录并首先查找该目录。When searching for assembly dependencies, include the directory that contains the assembly itself, and search that directory first. 在路径传递到 Win32 LoadLibraryEx 函数之前,通过 .NET Framework 使用此值。This value is used by the .NET Framework, before the paths are passed to the Win32 LoadLibraryEx function. |
LegacyBehavior | 0 | 搜索应用程序目录,然后调用有 |
SafeDirectories | 4096 | 在 DLL 搜索路径中包含了应用程序目录、 |
System32 | 2048 | 在 DLL 搜索路径中包含了 |
UseDllDirectoryForDependencies | 256 | 搜索在搜索其他文件夹之前 DLL 所在文件夹中的依赖项。Search for the dependencies of a DLL in the folder where the DLL is located before searching other folders. |
UserDirectories | 1024 | 通过使用 Win32 |
注解
DefaultDllImportSearchPathsAttribute使用属性可以将一组路径应用于整个程序集或单个平台调用。Use the DefaultDllImportSearchPathsAttribute attribute to apply a set of paths to an entire assembly or to an individual platform invoke.