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

 

相关文章:

  • 2021-11-09
  • 2021-06-02
  • 2022-12-23
  • 2022-01-17
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-08
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2021-11-22
  • 2021-07-29
  • 2021-11-03
相关资源
相似解决方案