Share via


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 域服务层次结构中唯一标识此条目。 始终可以使用此路径检索条目。

适用于