Home > DeveloperSection > Forums > How to get application Directory using C#-Csharp
Andrew Watson
Andrew Watson

Total Post:39

Posted on    April-23-2011 4:22 AM

 C# C# 

 1 Reply(s)
 1504  View(s)
Rate this:
Hello everyone,
I am trying to get the directory of application root folder.
Please provide sample of code.

Uttam Misra

Total Post:124

Posted on    April-23-2011 4:28 AM

private static string GetAppFolderName( )
    string configPath = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
    FileInfo configFile = new FileInfo(configPath);
    return configFile.DirectoryName;

Don't want to miss updates? Please click the below button!

Follow MindStick