Thursday, March 12, 2009

Get Application Execution path in .NET


Desktop Application

System.Windows.Forms.Application.StartupPath

Windows Mobile Application C#

You should import using System.Reflection
by
using System.Reflection;

Assembly asm = Assembly.GetExecutingAssembly();
String path = "";
path= System.IO.Path.GetDirectoryName(asm.GetName().CodeBase);

Post a Comment