Get Current Directory for your Application C# , C Sharp

 

You can call this function to Current Directory for your running Application

 

public static string GetAppPath()
{
    string ExePath = System.Windows.Forms.Application.ExecutablePath;
    if (Path.GetDirectoryName(ExePath).EndsWith("\\"))
    {
        return Path.GetDirectoryName(ExePath);
    }
    else
    {
        return Path.GetDirectoryName(ExePath) + "\\";
    }
}

Leave a Reply

Your email address will not be published.