FileSystemEventArgs.ChangeType 属性
获取所发生的目录事件的类型。
**命名空间:**System.IO
**程序集:**System(在 system.dll 中)
语法
声明
Public ReadOnly Property ChangeType As WatcherChangeTypes
用法
Dim instance As FileSystemEventArgs
Dim value As WatcherChangeTypes
value = instance.ChangeType
public WatcherChangeTypes ChangeType { get; }
public:
property WatcherChangeTypes ChangeType {
WatcherChangeTypes get ();
}
/** @property */
public WatcherChangeTypes get_ChangeType ()
public function get ChangeType () : WatcherChangeTypes
属性值
WatcherChangeTypes 值之一,表示在文件系统中检测到的更改种类。
示例
下面的示例阐释了 ChangeType 属性。此代码示例摘自一个为 FileSystemEventArgs 类提供的更大的示例。
' 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
平台
Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
FileSystemEventArgs 类
FileSystemEventArgs 成员
System.IO 命名空间
WatcherChangeTypes