.

get useful directories programatically

AppDomain.CurrentDomain.BaseDirectory

Directory.GetCurrentDirectory()

this.GetType().Assembly.Location
- Returns the full path for the calling assembly – includes the assembly name as well (*.dll)

Application.StartupPath

Application.ExecutablePath    (Windows.Forms call)
- Returns Application.StartupPath + application name (*.exe)

Environment.CurrentDirectory

Path.GetFullPath(“.”)

string file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), “cookies.dat”);
“C:\\Users\\<MyUserName>\\AppData\\Local\\cookies.dat”

What's your thoughts on this?

*

Protected by WP Anti Spam