zoukankan      html  css  js  c++  java
  • ASPNET下的路径辅助类

    using   System;
    using   System.Web;

    namespace   SysClassLibrary.Common
    {
    ///   <summary>
    ///   Application   的摘要说明。
    ///   网站相关路径信息
    ///   </summary>
    public   class   Application   :System.Web.HttpApplication
    {
    public   Application()
    {
    this.Init();
    }
    #region   初始化
    public   override   void   Dispose()
    {
    base.Dispose   ();
    }

    public   override   void   Init()
    {
    base.Init   ();
    }
    #endregion
    #region   相关参数
    ///   <summary>
    ///   应用程序对应物理目录
    ///   </summary>
    public   static   string   PhysicalApplicationPath
    {
    get
    {
    return   HttpContext.Current.Request.PhysicalApplicationPath;
    }
    }
    ///   <summary>
    ///   应用程序文件物理路径
    ///   </summary>
    public   static   string   PhysicalPath
    {
    get
    {
    return   HttpContext.Current.Request.PhysicalPath;
    }
    }
    ///   <summary>
    ///   应用程序虚拟目录名称
    ///   </summary>
    public   static   string   ApplicationPath
    {
    get
    {
    return   HttpContext.Current.Request.ApplicationPath;
    }
    }
    ///   <summary>
    ///   Javascript脚本目录地址   :http://localhost/hwe/cmdjs/
    ///   </summary>
    public   static   string   JsFilesPath
    {
    get
    {
    return   ApplicationPathUrl+ "/cmdjs/ ";
    }
    }

    ///   <summary>
    ///   Style样式表目录地址   :http://localhost/hwe/cmdimg/
    ///   </summary>
    public   static   string   StyleFilePath
    {
    get
    {
    return   ApplicationPathUrl+ "/cmdimg/ ";
    }
    }
    ///   <summary>
    ///   XmlDocument   虚拟目录位置  
    ///   </summary>
    public   static   string   XmlDocumentPath
    {
    get
    {
    return     PhysicalApplicationPath   +@ "XmlDocument\ ";
    }
    }


    ///   <summary>
    ///   应用程序地址   :http://localhost/hwe
    ///   </summary>
    public   static   string   ApplicationPathUrl
    {
    get
    {
    HttpContext   c   =   HttpContext.Current   ;
    if(HttpContext.Current.Server.MapPath( ". ")!= "/ ")
    return   "http:// "+System.Net.Dns.GetHostName()+ApplicationPath;
    else
    return   "http:// "+System.Net.Dns.GetHostName();
    }
    }
    ///   <summary>
    ///   应用程序签名路径
    ///   </summary>
    public   static   string   IdiographPath
    {
    get
    {
    return   ApplicationPathUrl+ "/qm/ ";  
    }
    }

                    #endregion
    }
    }

    魔兽就是毒瘤,大家千万不要玩。
  • 相关阅读:
    hadoop目录命令
    spark简单文件配置
    git简单使用
    1
    环境
    spring boot入门学习---热部署
    浅谈-对modbus的理解
    springboot集成调用Azkaban
    搭建自己的maven私服 必过
    Spring Boot 出现 in a frame because it set 'X-Frame-Options' to 'DENY'
  • 原文地址:https://www.cnblogs.com/tracy/p/1782277.html
Copyright © 2011-2022 走看看