If I use Application.StartupPath or AppDomain.CurrentDomain.BaseDirectory This is a search in the bin \ debug folder for the file but I have to use the folder from my root directory "Resources \ imagefile.png" in the ma C # .net project!
Filestream fs;
fs = new Filestream(AppDomain.CurrentDomain.BaseDirectory + "folder\\imagefile.png");
So, how to write code to read the file from my root directory, despite using the above code or the full path to the directory, which is "@C: .......", and even Server.MapPath - we can’t use it .
To get my path to the application, but it gives something like C: \ Projects \ XYZ \ ABC \ Bin \ Debug
I do not want bin \ Debug. Is there any way to achieve this?
source
share