|
Hi,
I am trying to trite a small app that acceses internet browser history on IExplorer using its registry. Somehow i cannot delete the URLs that have been viewed.
note: After accesing the registry i store the data in a checkedlistbox. Any help?
private void Delete_Click(object sender, EventArgs e)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\TypedURLs", true);
string[] v = key.GetValueNames();
string[] t = new string[v.Length];
int count = checkedListBox1.Items.Count;
for (int i = 0; i < v.Length - 1; i--)
{
t[i] = (string)key.GetValue(v[i]);
if(t[i] == (string)checkedListBox1.SelectedItem)
{
key.DeleteValue(t[i]);
}
}
for ( int i = count; i > 0; i--)
{
if (checkedListBox1.CheckedItems.Contains(checkedListBox1.Items[i - 1]))
{
checkedListBox1.Items.RemoveAt(i - 1);
}
}
|
|
|
|
|
Um:
for (int i = 0; i < v.Length - 1; i--)
{
t[i] = (string)key.GetValue(v[i]);
i-- ? Really?
We all do it at some point...
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
wow....that was just to stupid....sorry...thanks alot!!! I really apreciate
|
|
|
|
|
As I said - we've all done it!
(I tend to read what I meant to write which doesn't help... )
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
I think it was nearly OK before -- I find removing items from a list in reverse is easier -- but you would need to use
for ( int i = count<big>-1</big>; i ><big>=</big> 0; i--)
|
|
|
|