FileSystemProxy.Drives 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個唯讀的磁碟機名稱集合。
public:
property System::Collections::ObjectModel::ReadOnlyCollection<System::IO::DriveInfo ^> ^ Drives { System::Collections::ObjectModel::ReadOnlyCollection<System::IO::DriveInfo ^> ^ get(); };
public System.Collections.ObjectModel.ReadOnlyCollection<System.IO.DriveInfo> Drives { get; }
member this.Drives : System.Collections.ObjectModel.ReadOnlyCollection<System.IO.DriveInfo>
Public ReadOnly Property Drives As ReadOnlyCollection(Of DriveInfo)
屬性值
一個只讀的集合,將所有可用硬碟作為 DriveInfo 物件。
範例
此範例顯示可用磁碟名稱的訊息框。
Dim getInfo = System.IO.DriveInfo.GetDrives()
For Each info In getInfo
MsgBox(info.name)
Next
備註
此特性會回傳所有邏輯磁碟。