Directory.GetCurrentDirectory Method
Click or drag to resize
DirectoryGetCurrentDirectory Method
Gets the current working directory of the application.

Namespace: Alphaleonis.Win32.Filesystem
Assembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax
public static string GetCurrentDirectory()

Return Value

Type: String
The path of the current working directory without a trailing directory separator.
Remarks

MSDN: Multithreaded applications and shared library code should not use the GetCurrentDirectory function and

should avoid using relative path names. The current directory state written by the SetCurrentDirectory function is stored as a global variable in each process,

therefore multithreaded applications cannot reliably use this value without possible data corruption from other threads that may also be reading or setting this value.

This limitation also applies to the SetCurrentDirectory and GetFullPathName functions. The exception being when the application is guaranteed to be running in a single thread,

for example parsing file names from the command line argument string in the main thread prior to creating any additional threads.

Using relative path names in multithreaded applications or shared library code can yield unpredictable results and is not supported.

See Also