Showing posts with label System.Reflection. Show all posts
Showing posts with label System.Reflection. Show all posts

Thursday, September 10, 2009

Get Application Startup Path – for NETCF

Why Application.StartupPath is missing in NETCF? I don’t know why either.. so most of you will try looking for some answer .. and the answer is this.

string startup = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
string directory = System.IO.Path.GetDirectoryName(startup);
string file = System.IO.Path.GetFileName(startup);