Get current folder path in C#
To get current directory in C# you can use any of below examples:Example 1
string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
string currentDir = System.IO.Directory.GetCurrentDirectory();
string currentDir = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
string currentDir = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
In this page (written and validated by A. Gawali) you learned about Get current folder path in C# . What's Next? If you are interested in completing C# tutorial, we encourage you simply to start here: C# Tutorial.
Share On: |