zoukankan      html  css  js  c++  java
  • IIS站点下多应用程序 C#获取根目录方法

    获取站点根目录:

    Server.MapPath(Request.ServerVariables["PATH_INFO"])
    Server.MapPath("/")
    Server.MapPath("")//当前代码文件所在的目录路径
    Server.MapPath(".")
    Server.MapPath("../")
    Server.MapPath("..")
    

      

    获取应用程序根目录:

    // 获取程序的基目录。
    System.AppDomain.CurrentDomain.BaseDirectory
    
    // 获取和设置包括该应用程序的目录的名称。
    System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase
    

      

  • 相关阅读:
    MongoDB数据类型
    杭电1257
    杭电1716
    杭电1997
    杭电1492
    杭电1208
    杭电1290
    杭电1087
    杭电1568
    杭电1398
  • 原文地址:https://www.cnblogs.com/ding2011/p/8554012.html
Copyright © 2011-2022 走看看