RenamedEventArgs.OldFullPath 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取受影响的文件或目录的前一个完全限定的路径。
public:
property System::String ^ OldFullPath { System::String ^ get(); };
public string OldFullPath { get; }
member this.OldFullPath : string
Public ReadOnly Property OldFullPath As String
属性值
受影响的文件或目录的前一个完全限定的路径。
示例
以下示例演示 属性 OldFullPath 。 此代码示例是为 RenamedEventArgs 类提供的一个更大示例的一部分。
// 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
注解
此属性返回初始化时使用 的相同路径 FileSystemWatcher
,即使它是相对路径。