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

1 comment:

  1. Thank you. This was just what I was looking for.



Note: Only a member of this blog may post a comment.