简体   繁体   中英

Can't use Server.MapPath

I'm trying to use Server.MapPath instead of the complete path which basically looks like this

CsvFile= @"D:\web\finalsa\en\csr\download_center\Click_Counter.csv";

The file where i write this line is located in :

D:\web\finalsa\en\include";

Therefore i tried to write this without any success:

CsvFile= Server.MapPath("../csr/download_center/Click_Counter.csv");

Can anyone tell me what i'm doing wrong ? Thanks in advance

NOone can as you do not tell us how the web server is configured.

BUt what you can do is map "." and see where this ends up. That is the current directory. Likely you have an issue that you think that is somewhere else than you think - a 1 minute debugging run will help you to find out whether you are right or wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM