zoukankan      html  css  js  c++  java
  • Server.MapPath()目录详解

    最近在做相关的开发,碰到了Server.MapPath(),顺便来温习一下
    Server.MapPath()获取网站的目录详解 
    1. ./当前目录
    2. /网站主目录
    3. ../上层目录
    4. ~/网站虚拟目录
    • 如果当前的网站目录为E:www123,应用程序虚拟目录为E:www123wlj ,浏览的页面路径为E:www123wljhahaheihei.asp。
    • 例子:heihei.asp页面中的具体使用如下
    • Server.MapPath("./")   返回路径为:E:www123wljhaha
    • Server.MapPath("/")    返回路径为:E:www123
    • Server.MapPath("../")   返回路径为:E:www123wlj
    • Server.MapPath("~/")   返回路径为:E:www123wlj
    • server.MapPath(request.ServerVariables("Path_Info")) 
    • Request.ServerVariables("Path_Translated") 
    • 上面两种方式返回路径为 D:www123wljhahaheihei.asp
  • 相关阅读:
    2019.8.8 python day03
    2019.8.7 python进阶day02
    2019.8.6(python day01)
    2019.8.5
    2019.8.2
    2019.8.1
    2019.7.31
    2019.7.30
    面向对象进阶
    访问可见性问题和@property装饰器
  • 原文地址:https://www.cnblogs.com/1175429393wljblog/p/5497065.html
Copyright © 2011-2022 走看看