Export (0) Print
Expand All
Expand Minimize

My.Computer.FileSystem.CreateDirectory Method 

Creates a directory.


' Usage
My.Computer.FileSystem.CreateDirectory(directory)
' Declaration
Public Sub CreateDirectory( _
   ByVal directory As String _
)

Parameters

directory

String. Name and location of the directory. Required.

The following conditions may cause an exception:

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 in Visual Basic

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")

Namespace: Microsoft.VisualBasic.MyServices

Class: FileSystemProxy (provides access to FileSystem)

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type Available

Windows Application

Yes

Class Library

Yes

Console Application

Yes

Windows Control Library

Yes

Web Control Library

Yes

Windows Service

Yes

Web Site

Yes

The following permission may be necessary:

Permission Description

FileIOPermission

Controls the ability to access files and folders. Associated enumeration: Unrestricted.

For more information, see Code Access Security and Requesting Permissions.

Community Additions

ADD
Show:
© 2015 Microsoft