2009-04-09 32 views
2

我試圖加載的形象是在我的項目的根目錄:如何在ASP.NET中加載圖像服務器端?

Dim b As Bitmap = New Bitmap("img.bmp") 

,但它似乎並沒有找到該文件。

我試過各種各樣的組合〜像img.gif,/ img.gif,\ img.gif,〜/ img.gif等,但似乎沒有工作。如何在ASP.NET中訪問「服務器上的當前目錄」?

感謝

回答

10

你試過:

Dim b As Bitmap = New Bitmap(HttpContext.Current.Server.MapPath("~/img.bmp")) 
+0

有關的權利 – TStamper 2009-04-09 22:13:59

相關問題