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
public enum DllImportSearchPath
type DllImportSearchPath = 
Public Enum DllImportSearchPath
繼承
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

搜尋應用程式目錄,然後呼叫含 LOAD_WITH_ALTERED_SEARCH_PATH 旗標的 Win32 LoadLibraryEx 函式。Search the application directory, and then call the Win32 LoadLibraryEx function with the LOAD_WITH_ALTERED_SEARCH_PATH flag. 如果沒有指定其他值,會忽略此值。This value is ignored if any other value is specified. 不支援 DefaultDllImportSearchPathsAttribute 屬性的作業系統會使用此值,而忽略其他值。Operating systems that do not support the DefaultDllImportSearchPathsAttribute attribute use this value, and ignore other values.

SafeDirectories 4096

將應用程式目錄、%WinDir%\System32 目錄和使用者目錄包含在 DLL 搜尋路徑中。Include the application directory, the %WinDir%\System32 directory, and user directories in the DLL search path.

System32 2048

%WinDir%\System32 目錄包含在 DLL 搜尋路徑中。Include the %WinDir%\System32 directory in the DLL search path.

UseDllDirectoryForDependencies 256

搜尋其他資料夾之前,先在 DLL 所在的資料夾中搜尋 DLL 的相依性。Search for the dependencies of a DLL in the folder where the DLL is located before searching other folders.

UserDirectories 1024

包含已使用 Win32 AddDllDirectory 函式明確新增至整個處理序搜尋路徑的任何路徑。Include any path that was explicitly added to the process-wide search path by using the Win32 AddDllDirectory function.

備註

使用 DefaultDllImportSearchPathsAttribute 屬性,將一組路徑套用至整個元件或個別平台叫用。Use the DefaultDllImportSearchPathsAttribute attribute to apply a set of paths to an entire assembly or to an individual platform invoke.

適用於