Is there an exception for a registrykey not found?

  • Thread starter Thread starter mutant
  • Start date Start date
M

mutant

Guest
Is there? I couldnt find one :rolleyes:
And I need it for my code because some other error may occur and I will have no idea if the registrykey was not found or something.
 
If youre using Settings, then you can do this...

Code:
Dim Settings(,) As String = GetAllSettings("SomeApp", "SomeSection")

If Not Settings Is Nothing Then
    Exists
else
    Does not
end if
 
No, im using the registry classes from the Win32 namespace. If I dont have any error handling for the registry key specifically, it could result in some bad things :(
 
If the key does not exist the RegistryKey object returned will be null (the Nothing keyword in Visual Basic .NET).
 
Back
Top