static void Main(string[] args)
{
RegistryKey rk = Registry.CurrentUser;
RegistryKey sk1 = rk.OpenSubKey(@"software\\microsoft\\internet explorer\\typedurls");
Class1 count = new Class1();
count.countnr();
int checkvalue = count.countnr();
string[] keys = new string[checkvalue];
for (int i = 0; i < checkvalue; i++)
{
string inputvalue = "url" + i.ToString();
keys[i] = (string)sk1.GetValue(inputvalue);
}
foreach (string s in keys)
{
TextWriter str = new StreamWriter(@"c:\urlvalue.txt");
str.WriteLine(s);
str.Close();
}
}
Edit: i figured out the problem I had at first, however a new problem arose.
As you can see I use this in my for iteration
for (int i = 0; i < checkvalue; i++)
{
string inputvalue = "url" + i.ToString();
keys[i] = (string)sk1.GetValue(inputvalue);
}
checkvalue is the total amount of keys listed in the registry.
However when i change i <= checkvalue i get a runtime error, but the thing is, by using i < checkvalue i do NOT get a runtime error but the last value isnt listed.
Any ideas?
Edited by noxrawr, 03 June 2010 - 01:07 AM.


Sign In
Create Account


Back to top









