Guest pai Posted May 4, 2005 Report Posted May 4, 2005 I want to get the pathname of the current directory in a c# program, but after searching in internet, i got none. So, if anybody tell me how to get the current directory name? Thanks
Guest pai Posted May 4, 2005 Report Posted May 4, 2005 I want to get the pathname of the current directory in a c# program, but after searching in internet, i got none. So, if anybody tell me how to get the current directory name? Thanks <{POST_SNAPBACK}> by using [C#] public static string GetCurrentDirectory(); I got not support exception, wrong :cry:
Guest pai Posted May 4, 2005 Report Posted May 4, 2005 .NET Compact Framework Platform Note: The .NET Compact Framework does not support GetCurrentDirectory because current directory functionality is not used in devices running Windows CE .NET.
Guest pai Posted May 4, 2005 Report Posted May 4, 2005 I have found the answer in a forum, the user has asked the same question and later he gave the answer by himself. So, i write them here down, maybe it is for someone useful, maybe later. string path = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase; path = Path.GetDirectoryName(path);
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now