我有一个提供 PDF 文档的 ashx 文件。我们的环境是我们在本地开发,Web 应用程序被移动到不同的环境:测试,然后是生产。
访问服务器路径的最佳方式是什么?如何在 .ashx 处理程序中使用 Server.MapPath()
。
最佳答案
您可以通过HttpContext
访问Server
。
public void ProcessRequest(HttpContext context) {
context.Server.MapPath(...);
}
关于c# - ashx 中的 Server.MapPath?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19182900/