ASP.NET 網頁開發

[.NET] Server.MapPath抓取主機路徑

2008/12/19
▪ ServerPath.cs的code protected void Page_Load(object sender, EventArgs e) { Response.Write("根目錄:" + Server.MapPath("~\\") + "<BR>"); Response.Write("檔案目前位置:" + Server.MapPath(".\\") + "<BR>"); } [範例下載]

▪ ServerPath.cs的code
protected void Page_Load(object sender, EventArgs e)
 {
  Response.Write("根目錄:" + Server.MapPath("~\\") + "<BR>");
  Response.Write("檔案目前位置:" + Server.MapPath(".\\") + "<BR>");
 }

[範例下載]