CurrentDirectory Property
Collapse the table of content
Expand the table of content

FileSystem.CurrentDirectory Property

 

Gets or sets the current directory.

Namespace:   Microsoft.VisualBasic.FileIO
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public static string CurrentDirectory { get; set; }

Property Value

Type: System.String

The current directory for file I/O operations.

Exception Condition
DirectoryNotFoundException

The path is not valid.

UnauthorizedAccessException

The user lacks necessary permissions.

CurrentDirectory is a system-wide environment variable.

This example returns the current directory and displays it in a message box.

MsgBox(My.Computer.FileSystem.CurrentDirectory)

This example sets the current directory to C:\TestDirectory.

My.Computer.FileSystem.CurrentDirectory = "C:\TestDirectory"

FileIOPermission

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft