状态: 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语句,其精妙之处值得细细体会。所以才把他写下来。
|