共用方式為


FileSystem.MkDir 方法

建立新目錄。My 功能提供比 MkDir 更強的檔案 I/O 作業產能和效能。如需詳細資訊,請參閱 My.Computer.FileSystem.CreateDirectory 方法

命名空間: Microsoft.VisualBasic
組件: Microsoft.VisualBasic (在 microsoft.visualbasic.dll 中)

語法

'宣告
Public Shared Sub MkDir ( _
    Path As String _
)
'用途
Dim Path As String

FileSystem.MkDir(Path)
public static void MkDir (
    string Path
)
public:
static void MkDir (
    String^ Path
)
public static void MkDir (
    String Path
)
public static function MkDir (
    Path : String
)

參數

  • Path
    必要項。String 運算式,可識別要建立的目錄。Path 可包含磁碟機。如果未指定磁碟機,則 MkDir 會在目前磁碟機上建立新目錄。

備註

如需詳細資訊,請參閱 Visual Basic 的主題 MkDir 函式

此函式會建立新目錄。

範例

此範例使用 MkDir 函式來建立目錄。如果未指定磁碟機,則會在目前磁碟機上建立新目錄。

' Make new directory.
MkDir("C:\TESTDIR")

平台

Windows 98、 Windows 2000 SP4、 Windows Millennium Edition、 Windows Server 2003、 Windows XP Media Center Edition、 Windows XP Professional x64 Edition、 Windows XP SP2、 Windows XP Starter Edition

.NET Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱系統需求一節的內容。

版本資訊

.NET Framework

支援版本:2.0、1.1、1.0

請參閱

參考

FileSystem 類別
FileSystem 成員
Microsoft.VisualBasic 命名空間
ArgumentException Class
IOException Class

其他資源

MkDir 函式
ChDir 函式
CurDir 函式
RmDir 函式
HOW TO:在 Visual Basic 中建立目錄