Gaurav Taneja

Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

  Home  |   Contact  |   Syndication    |   Login
  82 Posts | 1 Stories | 39 Comments | 7 Trackbacks

News




Google RankGoogle PR™ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.

Archives

Post Categories

Image Galleries

Atlas

Error

OutLook

SharePointService

Usefull Site Links

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)
posted on Wednesday, March 21, 2007 9:27 AM

Feedback

# re: Delete History. 3/21/2007 12:16 PM Marcus Shockley
Very nice.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: