📄 log.aspx.cs
字号:
using System;
using System.IO;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class manage_log : System.Web.UI.Page
{
protected DataTable table;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["delname"] != null)
{
string name = Request.QueryString["delname"].ToString();
if (name.IndexOf("\\") == -1 && name.IndexOf("//") == -1)
File.Delete(Server.MapPath("..\\systemlog\\")+name);
}
string file;
table=new DataTable();
table.Columns.Add("name");
table.Columns.Add("time");
string[] files = Directory.GetFiles(Server.MapPath("..\\systemlog\\"));
int count=files.Length;
for (int i = 0; i < count; i++)
{
file=files[i].Substring(files[i].LastIndexOf('\\')+1);
table.Rows.Add(new string[2] { file, new FileInfo(Server.MapPath("..\\systemlog\\") + file).LastWriteTime.ToString() });
}
this.List_Log.DataSource = table;
this.List_Log.DataBind();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -