namespace
{
DeleteHistory /// <summary>
/// Summary description for Delete_History.
/// </summary>
{
{
public class Delete_History : System.Web.UI.Pageprotected System.Web.UI.WebControls.ListBox LstHistory;protected System.Web.UI.WebControls.Button Btn_Clr_History;string path;private void Page_Load(object sender, System.EventArgs e)// Put user code to initialize the page here
path = Environment.GetFolderPath(Environment.SpecialFolder.History) + "\\";
GetList(path);
}
#region
{
Web Form Designer generated codeoverride protected void OnInit(EventArgs e)//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
}
base.OnInit(e);/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
{
}
private void InitializeComponent()this.Btn_Clr_History.Click += new System.EventHandler(this.Btn_Clr_History_Click);this.Load += new System.EventHandler(this.Page_Load);
#endregion
{
DirectoryInfo dir =
DirectoryInfo[] dirs = dir.GetDirectories();
FileInfo[] files = dir.GetFiles();
{
GetList(d.FullName);
}
{
LstHistory.Items.Add(f.FullName);
}
}
{
{
public void GetList (string thePath)new DirectoryInfo(thePath);foreach(DirectoryInfo d in dirs)foreach(FileInfo f in files)public void ClrHistory()for(int i = 0 ; i < LstHistory.Items.Count ; i ++ )try
{
File.Delete(LstHistory.Items[i].Text);
}
{
Response.Write("Error :" + e.Message);
}
}
}
{
ClrHistory();
}
}
}
catch(IOException e)private void Btn_Clr_History_Click(object sender, System.EventArgs e)