FileSystem.CreateDirectory(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a directory.
public:
static void CreateDirectory(System::String ^ directory);
public static void CreateDirectory (string directory);
static member CreateDirectory : string -> unit
Public Shared Sub CreateDirectory (directory As String)
Parameters
- directory
- String
Name and location of the directory.
Exceptions
The directory name is malformed. For example, it contains illegal characters or is only white space.
directory
is Nothing
or an empty string.
The directory name is too long.
The directory name is only a colon (:).
The parent directory of the directory to be created is read-only.
The user does not have permission to create the directory.
Examples
This example creates the directory, NewDirectory
, in C:\Documents and Settings\All Users\Documents
.
My.Computer.FileSystem.CreateDirectory(
"C:\Documents and Settings\All Users\Documents\NewDirectory")
Remarks
If the directory already exists, no exception is thrown.
The following table lists an example of a task involving the My.Computer.FileSystem.CreateDirectory
method.
To | See |
---|---|
Create a directory | How to: Create a Directory in Visual Basic |
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om