| 发表于:2007-04-25 10:12:285楼 得分:0 |
private sub getufopath() dim nkeyhandle as long, nvaluetype as long, nlength as long dim svalue as string*255 dim nret as long nlength = 255 nret = regopenkey(hkey_local_machine, "software\2.0\install\currentinst\ ", nkeyhandle) if nret <> error_success then call regclosekey(hkey) goto errhandle: end if nret = regqueryvalueex(nkeyhandle, "configfile ", 0, reg_sz, svalue, nlength) if nret <> error_success then call regclosekey(hkey) goto errhandle: end if dim s as string s=left(svalue,instr(1,svalue,chr(0))-1) msgbox s + "aaaaa " call regclosekey(hkey) exit sub errhandle: msgbox err.description end sub 代码没经过测试,可能有问题,主要就是表达一个意思,不要用trim去除空格,因为我们不知道注册表中的内容是否含有空格 | | |
|