FileSystemEventArgs.FullPath 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得受影響檔案或目錄的完整路徑。
public:
property System::String ^ FullPath { System::String ^ get(); };
public string FullPath { get; }
member this.FullPath : string
Public ReadOnly Property FullPath As String
屬性值
受影響檔案或目錄的路徑。
範例
下列範例示範 FullPath 屬性。 此程式代碼範例是針對 類別提供的較大範例的 FileSystemEventArgs 一部分。
// This method is called when a file is created, changed, or deleted.
private static void OnChanged(object source, FileSystemEventArgs e)
{
// Show that a file has been created, changed, or deleted.
WatcherChangeTypes wct = e.ChangeType;
Console.WriteLine("File {0} {1}", e.FullPath, wct.ToString());
}
' This method is called when a file is created, changed, or deleted.
Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
' Show that a file has been created, changed, or deleted.
Dim wct As WatcherChangeTypes = e.ChangeType
Console.WriteLine("File {0} {1}", e.FullPath, wct.ToString())
End Sub
備註
這個屬性會傳回使用 初始化的相同路徑 FileSystemWatcher
,即使它是相對路徑也一樣。