FileSystemInfo.Refresh 方法

定义

刷新对象的状态。Refreshes the state of the object.

public:
 void Refresh();
public void Refresh ();
member this.Refresh : unit -> unit
Public Sub Refresh ()

异常

设备(如磁盘驱动器)未准备好。A device such as a disk drive is not ready.

注解

FileSystemInfo.Refresh拍摄当前文件系统中的文件快照。FileSystemInfo.Refresh takes a snapshot of the file from the current file system. Refresh即使文件系统返回不正确或过时的信息, 也无法更正基础文件系统。Refresh cannot correct the underlying file system even if the file system returns incorrect or outdated information. 这可能发生在 Windows 98 等平台上。This can happen on platforms such as Windows 98.

尝试获取属性信息Refresh之前必须调用, 否则信息将过时。Calls must be made to Refresh before attempting to get the attribute information, or the information will be outdated.

适用于

另请参阅