Is it possible to delete application’s all setting?

 Posted by Bhakti on 12/24/2009 | Category: ASP.NET Interview questions | Views: 2102

Yes, it is possible with DeleteSetting function.
The function can take 3 arguments of application name, section name and key name.
If all of these are present then it deletes the specified key. But in case if you have specified only first argument of application name, it deletes all settings.
DeleteSettings(“testApp”) ‘ Deletes all setting of testapp

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Ramesh99 on: 12/25/2009
Public Sub DeleteSetting( _
ByVal AppName As String, _
Optional ByVal Section As String = Nothing, _
Optional ByVal Key As String = Nothing _

' Place some settings in the registry.
SaveSetting("MyApp", "Startup", "Top", "75")
SaveSetting("MyApp","Startup", "Left", "50")
' Remove section and all its settings from registry.
DeleteSetting ("MyApp", "Startup")
' Remove MyApp from the registry.
DeleteSetting ("MyApp")

Login to post response