Gets and sets the current directory. The original directory is the one from which the process was started.
[Visual Basic] Public Shared Property CurrentDirectory As String [C#] public static string CurrentDirectory {get; set;} [C++] public: __property static String* get_CurrentDirectory(); public: __property static void set_CurrentDirectory(String*); [JScript] public static function get CurrentDirectory() : String; public static function set CurrentDirectory(String);
Get returns the current directory.
Set/Let is a string representing the fully qualified path of the current directory.
Exception Type | Condition |
---|---|
ArgumentException | The value passed to set is an empty string ("") or contains only whitespaces. |
ArgumentNullException | A null value or object is passed to set. |
IOException | An I/O error occurs. |
DirectoryNotFoundException | The value passed to set specifies a path that cannot be found. |
SecurityException | The caller does not have the required permission. |
NGWS Runtime Security:
FileIOPermissionAccess | Read and write permission to the directory. |