Goggy Posted June 16, 2006 Posted June 16, 2006 Dim objRegistry As RegistryKey = Registry.ClassesRoot Dim objDefaultIcon As RegistryKey = Registry.ClassesRoot Dim Names() As String = objRegistry.GetSubKeyNames For i As Int32 = 1 To Names.Length - 1 If Mid(Names(i), 1, 1) <> "." Then Exit For objRegistry = objRegistry.OpenSubKey(Names(i)) objDefaultIcon = objDefaultIcon.OpenSubKey(objRegistry.GetValue("") & "\DefaultIcon") Console.WriteLine(Names(i) & objDefaultIcon.GetValue("").ToString) ExtentionCollection.Add(i, Names(i)) Next the loops runs once...and then i get the error...maybe iam missing something simple...but i dont get it Quote
Goggy Posted June 16, 2006 Author Posted June 16, 2006 Solved it Dim objRegistry As RegistryKey = Registry.ClassesRoot Dim objDefaultIcon As RegistryKey = Registry.ClassesRoot Dim Names() As String = objRegistry.GetSubKeyNames For i As Int32 = 1 To Names.Length - 1 If Mid(Names(i), 1, 1) <> "." Then Exit For objRegistry = objRegistry.OpenSubKey(Names(i)) On Error Resume Next objDefaultIcon = objDefaultIcon.OpenSubKey(objRegistry.GetValue("") & "\DefaultIcon") Console.WriteLine(Names(i) & objDefaultIcon.GetValue("").ToString) ExtentionCollection.Add(i, Names(i)) objRegistry = Registry.ClassesRoot objDefaultIcon = Registry.ClassesRoot Next Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.