[ASP.NET] Server.MapPath 與 Request.MapPath

  • 14350
  • 0

[ASP.NET] Server.MapPath 與 Request.MapPath

許多時候我們需要取得檔案所在的路徑,手動紀錄一下。

2010-09-13_105512

 

輸出:

2010-09-13_105908

 

提醒:

若要在 App_Code 資料夾下面的 Class 使用 Server.MapPath 的話,又該如何做呢?

原文參考:http://www.dotblogs.com.tw/puma/archive/2008/03/16/1675.aspx

Step1:using System.Web;

Step2:利用HttpContext.Current.Server.MapPath就可以使用了

 

 

udn 的標籤:

三小俠  小弟獻醜,歡迎指教