您的位置:程序门 -> vb ->



注册表项不存在,跳转错误问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


注册表项不存在,跳转错误问题[已结贴,结贴人:startcomputer]
发表于:2007-06-10 09:51:57 楼主
private     sub     command1_click()    
set     bn     =     createobject( "wscript.shell ")
on   error   goto   err1    
text1(0).text   =   bn.regread( "hkey_local_machine\software\sonic\cineplayer\1.5\licenseaccepted ")
err1:    
      msgbox     ( "参数错误 ")    
end     sub    
 
以上是代码,运行以后不管有没有注册表项存在都会跳出错误提示。要怎么解决?能否添加一行代码检测注册表项是否存在,不存在则跳转到错误提示。
发表于:2007-06-10 10:12:371楼 得分:20
private     sub     command1_click()    
set     bn     =     createobject( "wscript.shell ")
on   error   goto   err1    
text1(0).text   =   bn.regread( "hkey_local_machine\software\sonic\cineplayer\1.5\licenseaccepted ")
exit   sub
err1:    
      msgbox     ( "参数错误 ")    
end     sub
发表于:2007-06-10 11:45:252楼 得分:0
哦。可以了,谢谢。
发表于:2007-06-10 11:49:193楼 得分:0
要怎么给分啊,提示:只有未结、非0分贴子才可以结贴给分


快速检索

最新资讯
热门点击