Can i do something like this in window Application?
HttpContext.Current.Server.MapPath("Email/ForgotPassword.txt"));
This project is a web based application.
And my next project is basically a window service…
Seeking for advice.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get the path that the Exe is running at (which is a good location to add paths like “Email”), use:
This path is the ..\bin\debug\Email path when you run it on VS and ..\Email path when you run it after installation.
There are few alternates to do this like these to access the directory path:
or
you can do manipulation with the Path class like get the full path, directory name etc etc..
Check this MSDN forum thread How to get the current directory path c# winfows for application for details.