简体   繁体   English

无法使用Server.MapPath

[英]Can't use Server.MapPath

I'm trying to use Server.MapPath instead of the complete path which basically looks like this 我正在尝试使用Server.MapPath而不是基本上看起来像这样的完整路径

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. 因为您没有告诉我们Web服务器的配置方式,所以没有人可以提供。

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. 可能您有一个问题,认为与您想像的不一样-1分钟的调试运行将帮助您确定是对还是错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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