FileSystemEventArgs.FullPath 属性

定义

获取受影响的文件或目录的完全限定的路径。

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 ,即使它是相对路径。

适用于