I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)
Does anyone know of a built-in method in .NET to do this?
I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)
Does anyone know of a built-in method in .NET to do this?
Application.Current results in an appdomain http://msdn.microsoft.com/en-us/library/system.appdomain_members.aspx
Also this should give you the location of the assembly
I seem to recall there being multiple ways of getting the location of the application. but this one worked for me in the past atleast (it's been a while since i've done winforms programming :/)
System.Windows.Forms.Application.StartupPath
will solve your problem, I thinkThis could help;
also here is the reference
In VB.NET
In C#