注册表操作

80酷酷网    80kuku.com

  注册表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 

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: