Server.Mappath()在远程服务器上失败

时间:2020-05-03 19:51:38

标签: c# localhost remote-server

我使用这样的代码来准备路径。

Singleton

我在本地主机上运行此代码时遇到此错误

loggedInUser

我认为这不是问题(它的Chrome安全性)。无论如何,文件路径都是正确的。

另一方面,当我将程序上传到主机时,它将“ file:/// C:/ Inetpub / vhosts”添加到链接的前面。我如何取消这部分。我怎么做到

string path = Server.MapPath("~/"+ User.Identity.Name+ "/file.zip");

这是远程主机上的错误

 Index:582 Not allowed to load local resource: file:///C:/Users/trkmml/Documents/GitHub/OfisTakip/trkmml/file.zip

0 个答案:

没有答案
相关问题