using System.IO; public static void DeleteDir(string aimPath) |
例子:
protected void BtnDelete_Click(object sender, ImageClickEventArgs e)
{
var Row = this.UltraWebGrid1.DisplayLayout.ActiveRow;
string brName = (string)Row.Cells.FromKey("Name").Value;
string filename = Server.MapPath("../");
string pathname = filename + @"backupAndRestore/" + brName;
File.Delete(pathname);
Response.Write("<script type='text/javascript'>window.location='frmDBBackup.aspx';</script>");
}