vb读写注册表

Private Sub Command1_Click()

Dim MySettings As Variant

‘ Place some settings in the registry.

SaveSetting “MyApp”, “Startup”, “Top”, 75

SaveSetting “MyApp”, “Startup”, “Left”, 50

Debug.Print GetSetting(appname:=”MyApp”, section:=”Startup”, _

Key:=”Left”, Default:=”25″)

DeleteSetting “MyApp”, “Startup”

End Sub

运行后到注册表的HKEY_CURRENT_USER\Software\VB and VBA Program Settings键值下查看

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注


*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>