Questions and Answers on any aspect of .NET. Now closed.
Hello, is there a way to know the directory where the program is at?
For example, with my program I must distribute an external folder with documents.
And in the program I need to know where the program is, so I can know where the folder is.
So how do I know from C# where the program.exe is at, so the application is more flexible in terms of directories.
Monday, November 12, 2007
But keep in mind that you typically can't create files under that directory if it is under "c:\Program Files" unless you have admin privileges. So what I do is have all of my support files like bitmaps and such under the program directory. And then configuraton, settings, and log files get created under the appropriate user directory using:
The path above is common to all users of the machine. If I want to have a user-specific folder I would use:
Wednesday, November 14, 2007
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz