Επεξεργασία

Κοινή χρήση μέσω


FileSystemProxy.CreateDirectory(String) Method

Definition

Creates a directory.

public:
 void CreateDirectory(System::String ^ directory);
public void CreateDirectory (string directory);
member this.CreateDirectory : string -> unit
Public 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 examples of tasks involving the My.Computer.FileSystem.CreateDirectory method.

To See
Create a directory How to: Create a Directory

Applies to

See also