RenamedEventArgs.OldFullPath RenamedEventArgs.OldFullPath RenamedEventArgs.OldFullPath RenamedEventArgs.OldFullPath Property

定义

获取受影响的文件或目录的前一个完全限定的路径。Gets the previous fully qualified path of the affected file or directory.

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

属性值

受影响的文件或目录的前一个完全限定的路径。The previous fully qualified path of the affected file or directory.

示例

下面的示例演示了OldFullPath属性。The following example demonstrates the OldFullPath property. 此代码示例是为RenamedEventArgs类提供的更大示例的一部分。This code example is part of a larger example provided for the RenamedEventArgs class.

//  This method is called when a file is renamed.
private static void OnRenamed(object source, RenamedEventArgs e)
{
    //  Show that a file has been renamed.
    WatcherChangeTypes wct = e.ChangeType;
    Console.WriteLine("File {0} {2} to {1}", e.OldFullPath, e.FullPath, wct.ToString());
}
' This method is called when a file is renamed.
Private Sub OnRenamed(ByVal source As Object, ByVal e As RenamedEventArgs)

    ' Show that a file has been renamed.
    Dim wct As WatcherChangeTypes = e.ChangeType
    Console.WriteLine("File {0} {2} to {1}", e.OldFullPath, e.FullPath, wct.ToString())
End Sub

安全性

FileIOPermission
用于读取文件。for reading files. 关联的枚举:ReadAssociated enumeration: Read

适用于