Home
Manage Your Code
Snippet: Executing File Directory (The Correct Way) (C#)
Title: Executing File Directory (The Correct Way) Language: C#
Description: Often people will use Environment.CurrentDirectory to get what they think is the executing files directory. In reality, it is only sometimes the executing files directory. This shows the correct way to always get the executing files directory. Views: 440
Author: James Taylor Date Added: 9/25/2007
Copy Code  
1string correctPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);