我想指定文件的虚拟路径, 但我无法这样做 。
这是我的代码:
int Course_Id = 1;
int PortfolioID=1;
int ChandidateID=1;
string filepath = Server.MapPath("~/ePortfolio/PortFolioContent/" + Course_Id + "/Assignments/Exhb_" + item.PortfolioID + "_" + item.ChandidateID + ".jpg");
if(System.IO.File.Exists((filepath)))
{
ViewBag.Thumbnail = filepath;
}
When i use Server.MapPath it is fetching data from some other path:
My original path is:
E:HOBBYHOMES(E-PORTFOLIO)HobbyHomesWebAppePortfolioPortFolioContent1Assignments
but it is taking this path
E:HOBBYHOMES(E-PORTFOLIO)HobbyHomesWebAppActivityPostinImagesePortfolioPortFolioContent1AssignmentsExhb_1_1.jpg
I m not understanding why this is workin so.Please help me