我无法使用
获取 Application_Start 中的当前物理路径HttpContext.Current.Request.PhysicalApplicationPath
因为当时没有Request对象。
我还能如何获得物理路径?
最佳答案
protected void Application_Start(object sender, EventArgs e)
{
string path = Server.MapPath("/");
//or
string path2 = Server.MapPath("~");
//depends on your application needs
}
关于c# - 获取 Application_Start 中的当前应用程序物理路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1495504/