C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

Clear the TypedURLs History in ASP.NET


Posted Date: 29 Oct 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: Saravanan KanagarasuMember Level: Gold    
Rating: 1 out of 5Points: 10



The following code is used for delete the specific TypedURLs History. For ex, If you dont want keep the current project typedURLs in the history, you can use this to delete the TypedURLs history




using System;
using System.Data;
using System.Configuration;
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;
using System.Collections;
using Microsoft.Win32;

public partial class DeleteHistory : System.Web.UI.Page
{
Hashtable myTab = new Hashtable();

protected void Page_Load(object sender, EventArgs e)
{

}

protected void btnDelete_Click(object sender, EventArgs e)
{
DeleteHistory();
}

public void DeleteHistory()
{
RegistryKey myReg = Registry.CurrentUser.OpenSubKey("Software\\Microsoft" +
"\\Internet Explorer\\TypedURLs", true);
string[] names = myReg.GetValueNames();
for (int i = 0; i < names.Length; i++)
{
myTab.Add(names[i].ToString(), myReg.GetValue(names[i].ToString()));
}
ArrayList key = new ArrayList();
key = HistoryValue(myTab);
if (key.Count > 0)
{
for (int i = 0; i < key.Count; i++)
{
myReg.DeleteValue(key[i].ToString());
}

string message = "<script>alert('TypedURLs History Deleted');</script>";
Page.RegisterStartupScript("st", message);
}
}

public ArrayList HistoryValue(Hashtable myTab)
{
ArrayList val = new ArrayList();
foreach (DictionaryEntry de in myTab)
{
//if you want to delete the particular website related links,
//you can mention the web site address here
if (de.Value.ToString().Contains("http://127.0.0.1:8080/"))
{
val.Add(de.Key.ToString());
}
}
return val;
}
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Delete TypedURLs History in ASP.NET  .  Delete History in ASP.NET  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Validating Textboxes in Asp.Net
Previous Resource: Creating elegant grid pages using Telerik RadGrid
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use