SIMIN Posted September 4, 2008 Posted September 4, 2008 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 :) Quote
Nate Bross Posted September 4, 2008 Posted September 4, 2008 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. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
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.