1
所以我試着去開發一個網站的一個項目,該事情是我必須做到以下幾點:asp.net從網頁訪問的文件夾
管理員必須訪問的文件夾(我需要把一個按鈕管理頁面如此按下時會打開一個包含子文件夾的特定文件夾)。
該文件夾位於server.mappath中,與app_data位於同一級別,依此類推。
我需要一種方法來訪問它,因爲當我嘗試這樣做:
String foldername = "name";
Response.ContentType = "application/octet-stream";
Response.AppendHeader("content-disposition", "attachment;filename=" + foldername);
Response.TransmitFile(Server.MapPath("~/" + foldername));
Response.End();
我得到一個「訪問該文件夾被拒絕」錯誤:/
請幫助我必須做我的項目工作
在回答部分更新您的答案。 – Rajput
好的,我會做到的 –