SearchResult.Path 屬性

定義

取得這個 SearchResult 的路徑。

public:
 property System::String ^ Path { System::String ^ get(); };
public string Path { get; }
member this.Path : string
Public ReadOnly Property Path As String

屬性值

這個 SearchResult 的路徑。

範例

下列範例是 中的 SearchResult範例摘錄。 原始範例會建立具有所需路徑的新 DirectoryEntry 物件,並使用 FindOne 方法來起始搜尋。 執行搜尋之後,此範例會 GetDirectoryEntry 使用 方法來擷取搜尋結果中所識別的實時目錄專案。

此範例示範如何剖析 Path 搜尋結果中的屬性。

Dim mySearchResultPath As String = mySearchResult.Path  
Console.WriteLine("The path for the 'mySearchResult' search result is : {0}" + _  
                  ControlChars.Newline, mySearchResultPath)  
string mySearchResultPath = mySearchResult.Path;  
Console.WriteLine("The path for the 'mySearchResult' search "  
                  + "result is : {0}\n", mySearchResultPath);  
String^ mySearchResultPath = mySearchResult->Path;  
Console::WriteLine("The path for the 'mySearchResult' search result is : {0}\n", mySearchResultPath);  

備註

屬性Path可唯一識別 Active Directory 網域服務 階層中的這個專案。 專案一律可以使用這個路徑來擷取。

適用於