Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

       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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...