FileSystem.CurrentDirectory 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定目前的目錄。
public:
static property System::String ^ CurrentDirectory { System::String ^ get(); void set(System::String ^ value); };
public static string CurrentDirectory { get; set; }
static member CurrentDirectory : string with get, set
Public Shared Property CurrentDirectory As String
屬性值
目前用於檔案 I/O 操作的目錄。
例外狀況
這條路並不有效。
使用者缺乏必要的權限。
範例
此範例會回傳目前目錄,並以訊息框顯示。
MsgBox(My.Computer.FileSystem.CurrentDirectory)
此範例將當前目錄設定為 C:\TestDirectory。
My.Computer.FileSystem.CurrentDirectory = "C:\TestDirectory"
備註
CurrentDirectory 是一個系統範圍的環境變數。