Share via


IHierarchyData.Path 屬性

定義

取得節點的階層式路徑。

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

屬性值

String

String,識別相對於目前節點的階層式路徑。

範例

下列程式碼範例示範如何在實作 介面的類別中實 PathIHierarchyData 屬性。 類別會 FileSystemHierarchyData FileSystemInfo 包裝 物件,而 Path 屬性實作會傳回其檔案系統路徑。 此程式碼範例是介面和 HierarchicalDataSourceControl 類別所提供較大範例的 IHierarchyData 一部分。

// DirectoryInfo returns the OriginalPath, while FileInfo returns
// a fully qualified path.
public string Path
{
    get
    {
        return fileSystemObject.ToString();
    }
}
' DirectoryInfo returns the OriginalPath, while FileInfo returns
' a fully qualified path.

Public Overridable ReadOnly Property Path() As String _
 Implements IHierarchyData.Path
    Get
        Return fileSystemObject.ToString()
    End Get
End Property

備註

Path屬性可以傳遞至 GetHierarchicalView 方法,以擷取 HierarchicalDataSourceView 對應至 所識別節點的物件 Path

警告

屬性 Path 不應該包含主機環境的任何敏感性資訊,因為它可能會轉譯為資料繫結控制項中的用戶端。

適用於

另請參閱