i Want save image in Project Folder
so ho to get proper Path for Project
please Help me
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manish Kumar ChoudharyPosted Dec 19, 2014, 7:32 AM
Assembly.GetExecutingAssembly().GetName().CodeBase);
String strFullPathToMyFile = Path.Combine(strAppDir, "img1.jpeg");
MessageBox.Show(String.Format("Path to the application is: '{0}'." +
"Full path to the file in the application folder is: '{1}'",
strAppDir, strFullPathToMyFile));
Saber ShaikhPosted Dec 19, 2014, 7:30 AM
Manish Kumar ChoudharyPosted Dec 19, 2014, 7:28 AM
string startupPath = System.IO.Directory.GetCurrentDirectory();
string startupPath = Environment.CurrentDirectory;
Michal HabalcikPosted Dec 19, 2014, 7:28 AM
System.Reflection.Assembly.GetExecutingAssembly().Location or Application.StartupPath
In a Windows Forms app I would use "Application.StartupPath"
Saber ShaikhPosted Dec 19, 2014, 7:26 AM
i want do in windows Application
Manish Kumar ChoudharyPosted Dec 19, 2014, 7:23 AM
If you're trying to get the ASP.NET local path, use Server.MapPath("~/Images/img.jpeg") to get its fully qualified path.