There are some special directories easily available through use of the Environment.SpecialFolder enumeration: ApplicationData, Favorites, Personal, Programs, StartMenu and Startup. But it is a bit harder to e.g. get the current directory of the running application.
System.IO.Directory.GetCurrentDirectory() doesn’t work; it will give you an NotImplementedException at runtime.
To get it as string type:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
Note the GetModules()[0] if you have more than one module. To get the special folders:
Environment.GetFolderPath(Environment.SpecialFolder.Programs);
(I give up trying to format the text, this wordpress text editor is by far the worst I’ve ever tried!)
Posted by trnilse
Posted by trnilse
Posted by trnilse