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.

適用於

另請參閱