语法. SaveSettingappname,section,key,setting 2、GetAllSettings函数 语法. GetAllSettings(appname,section) 3、GetSetting函数 语法. GetSetting(appname,scetion,key[,default]) 4、DeleteSetting语句 语法. DeleteSettingappname,section,[key] 参数含义. appname. 字符串表达式,应用程序名 section. 字符串表达式,小节名 key. 字符串表达式,关键字名 setting. 表达式,关键字设定值 下面通过实例来说明它们的用法. 应用程序名为jld_app,小节名为startup,关键字为left。 在注册表中建立应用程序的注册项. SaveSetting“jld_app”,“startup”,“left”,100 从应用程序注册表项中读取所有关键字及其对应的值. Dimmysettings(10,10)AsVariant DimsettingindexAsInteger GetAllSettings“jld_app”,“startup” Forsettingindex=LBound(mysettings,1)ToUBound(mysettins,1) Debug.Printmysettings(settingindex,0);“=”;mysettings(settingindex,1) Nextsettingindex EndSub 从应用程序注册表项中读取关键字“left“的设置. Debug.PrintGetSetting(“jld_app”,“startup”,“left”,“notok”) 从WIN98注册表中删除小节“startup” DeleteSetting“jld_app”,“startup” 四、注册表的备份 Windows每次启动都会自动对注册表进行备份。放在windows\sysbckup里的rb00X.cab文件里,出注册表出现问题,在DOS下用extract /e展开,拷贝回去就可以了。
|