Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the current directory in compact framework?

How do you get the current directory where your app is running?

like image 321
nportelli Avatar asked Nov 12 '08 14:11

nportelli


People also ask

How do I get the current working directory in C#?

var currentDirectory = System. IO. Directory. GetCurrentDirectory();


1 Answers

You could try this:

using System.IO;
using System.Reflection;

namespace Utilities
{
    static public class DirectoryHelper
    {
        static public string GetCurrentDirectory ()
        {
            return Path.GetDirectoryName (Assembly.GetExecutingAssembly ().GetName ().CodeBase);
        }
    }
}
like image 55
Kieron Avatar answered Sep 28 '22 04:09

Kieron