How do you get the current directory in compact framework?

nportelli picture nportelli · Nov 12, 2008 · Viewed 10.6k times · Source

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

Answer

Kieron picture Kieron · Nov 12, 2008

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);
        }
    }
}