What is the best method of getting the path the C# executable is running from?
I need to use it for temp folders etc and currently I\'m using:
Path.G
For temp folders etc. you should NOT use the executing directory for security reasons... MS has something built-in for this:
You can use ApplicationData (for roaming users) or LocalApplicationData (for non-roaming users) or CommonApplicationData (for non-user-related things) from Environment.SpecialFolder - anything (files+folders) you create within those folders is already setup with the needed permissions/rights for the user running you app - nobody else (except perhaps Administrator) can go there... to make it even more secure you could encrypt data you put there...
see http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx