public sub savesettings() dim parentkey as microsoft.win32.registrykey = microsoft.win32.registry.currentuser.opensubkey("software", true) dim key as microsoft.win32.registrykey = parentkey.opensubkey(mcapplicationname, true) if key is nothing then key = parentkey.createsubkey(mcapplicationname) end if with key .setvalue("host name", me.hostnameentry.text) .setvalue("host port", me.hostportentry.text) .setvalue("user name", me.usernameentry.text) .setvalue("user password", me.userpasswordentry.text) end with end sub