gpt4 book ai didi

c# - ashx 中的 Server.MapPath?

转载 作者:太空狗 更新时间:2023-10-29 22:03:05 26 4
gpt4 key购买 nike

我有一个提供 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com