Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个网络应用程序可以将文件上传到一个文件夹。现在我想使用WCF服务从该文件夹中删除文件。在asp.net我们使用string filePath = Server.MapPath(FPath);中,但这不适用于WCF.
WCF
asp.net
string filePath = Server.MapPath(FPath);
有什么帮助吗?
我猜你只需要将其更改为:
string filePath = HttpContext.Current.Server.MapPath(FPath)