, ...
If it is in Asp.Net, you can use Server.MapPath , as in
string fileLocation = Server.MapPath("~/SomeAppRelativeDirectory/SomeFile.ext");
In a WinForms or Console application, if the file refers to an executable file, you can try to use System.Environment.CurrentDirectory
as in
string fullPath = System.IO.Path.Combine(System.Environment.CurrentDirectory, "SomeAppRelativeDirectory/SomeFile.ext");
source
share