Click here to Skip to main content
6,595,444 members and growing! (19,878 online)
Email Password   helpLost your password?
Languages » C# » How To     Intermediate License: The Code Project Open License (CPOL)

Modify the list of typed URLs in IE

By MinaFawzi

How to modify the list of typed URLs in IE.
C#, Windows, .NET 1.1VS.NET2003, Dev
Posted:8 May 2005
Views:25,263
Bookmarked:10 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
10 votes for this article.
Popularity: 2.04 Rating: 2.04 out of 5
4 votes, 40.0%
1
2 votes, 20.0%
2

3
2 votes, 20.0%
4
2 votes, 20.0%
5

Sample Image

Introduction

You can simply clear the typed URLs in IE by clicking on: Tools ---> Internet options ---> then Clear History. But it will be clear to anyone that you have deleted all your History. In this simple article, I will show you how to delete only specified URLs.

Using the Regedit

You can do this by using the regedit.exe program that helps you to edit in the registry. You can run this program by typing "regedit" in the Run command box. Then expand the following keys:

  • HKEY_CURRENT_USER
  • SOFTWARE
  • Internet Explorer
  • Typed URLs

This will display a list of values of all your typed URLs. This simple program will make this task easy and you will know the basic methods to access the registry which is the heart of Windows.

Using the code

The program is a simple Windows Form that contains two Buttons and a ListBox.

For basic operation on the registry use the microsoft.win32 namespace, then we need to declare the following types:

// this is the basic class to deal with registry
RegistryKey MyReg ;
// this is a string array that
// will hold all the key names of a specified subkey
string [] names;

The first button will fill the ListBox with all the typed URLs, and its code will go like this:

private void button1_Click(object sender, System.EventArgs e)
{
    // clear the listbox
    listBox1.Items.Clear();
    // use the regisry class to get the path to the specified subkey
    MyReg = Registry.CurrentUser.OpenSubKey("Software\\Microsoft" + 
            "\\Internet Explorer\\TypedURLs",true);
    // fill the array with all the names in this subkey
    names = MyReg.GetValueNames();
    for(int i=0;i< names.Length;i++)
        //fill the listbox with these entries
        listBox1.Items.Add(MyReg.GetValue(names[i]));
}

Then if u choose a URL and click on the Delete button, the following code will execute:

private void button2_Click(object sender, System.EventArgs e)
{
    if(listBox1.SelectedIndex != -1)
    // check that there is an item is selected
    {
        // delete the value from registry
        MyReg.DeleteValue((string)names[listBox1.SelectedIndex]);
        // remove the item from the list
        listBox1.Items.Remove(listBox1.SelectedItem);
    }
    else
        MessageBox.Show("Please choose a URL to be deleted"); 
}

References

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

MinaFawzi


Member
Mina Fawzi
Faculty of engineering Ainshams university In CAIRO
intersted in .net technology and DirectX
Occupation: Web Developer
Location: Egypt Egypt

Other popular C# articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 5 of 5 (Total in Forum: 5) (Refresh)FirstPrevNext
Generalhow do i run this program Pinmemberwim014:36 2 Jun '09  
GeneralRe: how do i run this program PinmemberMinaFawzi4:33 21 Jun '09  
GeneralCute but ....... Pinmemberfwsouthern18:38 9 May '05  
GeneralRe: Cute but ....... PinmemberMinaFawzi0:17 10 May '05  
GeneralPorn trick PinmemberArch4ngel4:05 9 May '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 8 May 2005
Editor: Sean Ewington
Copyright 2005 by MinaFawzi
Everything else Copyright © CodeProject, 1999-2009
Web10 | Advertise on the Code Project