I am develpoing smart device application in C#. I want the exact path of my application. My application resides on my machine at F:/MobileAppl/ManagedAppl. So I want this path in smart device application. Please make sure that all the functions of .net framework does not work in .net compact framework. Can you provide me the code or link through which i can resolve the above issue?
A:
public static string getPath()
{
string fullname;
string myAppPath;
fullname = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
myAppPath = System.IO.Path.GetDirectoryName(fullname);
myAppPath = myAppPath.Replace("file:\\", "");
return myAppPath;
}
thelost
2010-03-04 07:43:22
here is a link to the above method that might be useful. http://msdn.microsoft.com/en-us/library/ms229654.aspx
SetiSeeker
2010-03-04 07:54:20
After deploying the application on emulator it is giving the path as "/Program files/managedappl". But I want the path as "F:/MobileAppl/ManagedAppl". What should I need to do?
Shailesh Jaiswal
2010-03-04 09:05:48