how to get the application path in windows forms , i used the bellow code but it is saying like "method not found"
Application.ExecutablePath;
Application.StartupPath;
please suggest me am i missing any namespace ?
thanks in advance
how to get the application path in windows forms , i used the bellow code but it is saying like "method not found"
Application.ExecutablePath;
Application.StartupPath;
please suggest me am i missing any namespace ?
thanks in advance
This will return the complete path to your Application
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
You can do it like this as well
System.AppDomain.CurrentDomain.BaseDirectory
System.Windows.Forms.Application.StartupPath
must return the path of the running executable.
Add reference System.Windows.Forms
and add in using section
using System.Windows.Forms;
Generally, Application.StartupPath()
will give the path of the application. And also r u missing this namespace. System.Windows.Forms