对 HttpServerUtility 对象的 MapPath方法的试验

来源:百度文库 编辑:神马文学网 时间:2024/05/10 12:02:37
对 HttpServerUtility 对象的 MapPath方法的试验
状态:
1。IIS的根目录==>c:\inetpub\wwwroot
2。虚拟目录"oas"==>F:\hskama\oas
3。在http://localhost/oas/sys/others/mkm.aspx执行Response.Write(XXX)
结果:
Server.MapPath(".")             F:\hskama\oas\sys\others
Server.MapPath("~")             F:\hskama\oas
Server.MapPath("")              F:\hskama\oas\sys\others
Server.MapPath("..")            F:\hskama\oas\sys
Server.MapPath("~/..")          c:\inetpub\wwwroot
我觉得这个实验很有意思,虽然是一些简单的东西,但是我觉得对于以后项目的开发会很有意义,甚至觉得这有点类似于写SQL语句,其精妙之处值得细细体会。所以才把他写下来。