FileSystemEventArgs.FullPath 屬性

定義

取得受影響檔案或目錄的完整路徑。

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

屬性值

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 ,即使它是相對路徑也一樣。

適用於