Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

I use DeleteSetting to delete some application registry entries

DeleteSetting("MyApp", "Section")

It works well if the registry entry exists, but if not exist it will throw and exception, I catch it, but I want to prevent it from being thrown.

How can I check if this entry does not exist then don't run this code?

Thank you friends :)

Posted

You could try to read the setting if you get a null response, then you dont need to delete it.

 

However, trying to do a read if the registry key doesn't exist may throw an exception as well, I'm not sure I haven't used those methods.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

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...