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
    }
    }

    魔兽就是毒瘤,大家千万不要玩。
  • 相关阅读:
    Flex Box 简单弹性布局
    CSS 0.5px 细线边框的原理和实现方式
    前端模块化方案全解(CommonJS/AMD/CMD/ES6)
    用信鸽来讲解HTTPS的知识
    __name__ == "__main__"的作用是什么?
    如何自学计算机科学与技术(Teach Yourself Computer Science)
    中文技术文档的写作规范
    'adb remount'的作用是什么?在什么情况下有用?
    使用python遍历文件夹取出特定的字符串
    Python&Appium实现安卓手机图形解锁
  • 原文地址:https://www.cnblogs.com/tracy/p/1782277.html
Copyright © 2011-2022 走看看