https://localhost/WebDisk,點擊確定WebForm1.aspxNetWorkDisk.aspx 作為主頁面| 控制項類型 | ID | 用途 | 關鍵屬性 |
|---|---|---|---|
| FlowLayoutPanel | - | 標題區塊 | 文字:「網路硬碟——您的個人移動秘書」 |
| Label | Info | 訊息顯示 | ForeColor=Red, Text=空白 |
| Label ×3 | - | 區塊標題 | 文字:「目錄瀏覽」、「檔案上傳」、「目錄新建」 |
| ListBox | FileList | 檔案/目錄清單 | - |
| Button | BtnOpen | 開啟/進入 | Text="開啟" |
| Button | BtnDelete | 刪除 | Text="刪除" |
| File Field (HTML) | WebFile | 檔案選取 | type="file" |
| TextBox | NewDirName | 新目錄名稱 | - |
| Button | BtnUpLoad | 上傳送出 | Text="上傳" |
| Button | BtnNewDir | 建立目錄 | Text="新增目錄" |
| CheckBox | chkReadOnly | 唯讀屬性 | Text="唯讀" |
| CheckBox | chkHidden | 隱藏屬性 | Text="隱藏" |
必須切換至 HTML 原始碼檢視進行兩項修改:
<form id="WebForm1" method="post" runat="server"
enctype="multipart/form-data">
否則 File Field 控制項無法運作。
<INPUT runat="server" type="file" size="62"
id="WebFile" name="WebFile" ... >
補上 id 與 name 屬性,讓伺服器端程式碼能透過 WebFile.PostedFile 存取。
CurrentPath 追蹤目前目錄,支援多層導航LoadDir() 方法動態載入目錄內容繫結至 FileList此範例屬 ASP.NET Web Forms 經典架構(約 2003-2005 年)。現代開發建議: