FileSystemEventArgs.ChangeType 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得發生的目錄事件型別。
public:
property System::IO::WatcherChangeTypes ChangeType { System::IO::WatcherChangeTypes get(); };
public System.IO.WatcherChangeTypes ChangeType { get; }
member this.ChangeType : System.IO.WatcherChangeTypes
Public ReadOnly Property ChangeType As WatcherChangeTypes
屬性值
其中一個 WatcherChangeTypes 值,表示檔案系統中偵測到的變更類型。
範例
下列範例示範 ChangeType 屬性。 此程式代碼範例是針對 類別提供的較大範例的 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