FileSystemWatcher.OnChanged(FileSystemEventArgs) 方法
定义
protected:
void OnChanged(System::IO::FileSystemEventArgs ^ e);
protected void OnChanged (System.IO.FileSystemEventArgs e);
member this.OnChanged : System.IO.FileSystemEventArgs -> unit
Protected Sub OnChanged (e As FileSystemEventArgs)
参数
包含事件数据的 FileSystemEventArgs。A FileSystemEventArgs that contains the event data.
注解
OnChanged 当对受监视目录中的文件或目录的大小、系统属性、上次写入时间、上次访问时间或安全权限进行更改时,将调用。OnChanged is called when changes are made to the size, system attributes, last write time, last access time, or security permissions of a file or directory in the directory being monitored.
使用 NotifyFilter 属性可限制处理事件时引发的事件数 Changed 。Use the NotifyFilter property to restrict the number of events raised when the Changed event is handled.
OnCreated一旦创建了文件,就会引发事件。The OnCreated event is raised as soon as a file is created. 如果将文件复制或传输到受监视的目录, OnCreated 将立即引发事件,后跟一个或多个 OnChanged 事件。If a file is being copied or transferred into a watched directory, the OnCreated event will be raised immediately, followed by one or more OnChanged events.
引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关详细信息,请参阅 处理和引发事件。For more information, see Handling and Raising Events.
继承者说明
当 OnChanged(FileSystemEventArgs) 在派生类中重写时,请确保调用基类的 OnChanged(FileSystemEventArgs) 方法。When overriding OnChanged(FileSystemEventArgs) in a derived class, be sure to call the base class's OnChanged(FileSystemEventArgs) method.