zoukankan      html  css  js  c++  java
  • Server.MapPath() 用法

     ./当前目录
    /网站主目录
    ../上层目录
    ~/网站虚拟目录

    如果当前的网站目录为E:wwwroot   应用程序虚拟目录为E:wwwrootcompany 浏览的页面路径为E:wwwrootcompany ewsshow.asp
    在show.asp页面中使用
    Server.MapPath("./")   返回路径为:E:wwwrootcompany ews
    Server.MapPath("/")    返回路径为:E:wwwroot
    Server.MapPath("../")   返回路径为:E:wwwrootcompany
    Server.MapPath("~/")   返回路径为:E:wwwrootcompany
    server.MapPath(request.ServerVariables("Path_Info")) 
    Request.ServerVariables("Path_Translated")  
    上面两种方式返回路径为 D:wwwrootcompany ewsshow.asp

    否则写全命名空间:System.Web.HttpContext.Current.Server.MapPath();

  • 相关阅读:
    常用css3属性
    jQuery瀑布流
    jQuery事件对象
    jQuery动画
    面向对象复习
    php 面向对象
    git
    存储数据
    ajax
    对象
  • 原文地址:https://www.cnblogs.com/guanshan/p/guan045.html
Copyright © 2011-2022 走看看