用VB讀取登錄檔資料,VB讀取登錄檔

2022-01-07 19:06:04 字數 2761 閱讀 8884

1樓:vb問題大王

set sh = createobject("wscript.shell")

set sh = nothing

set oshell = nothing

strcomputer = "."

set objwmiservice = getobject("winmgmts:\\" & strcomputer & "\root\cimv2")

set colnetadapters = objwmiservice.execquery _

("select * from win32_networkadapterconfiguration where ipenabled=true")

strsubnetmask = array(subnetmask)

strgatewaymetric = array(1)

arrdnsservers = array(dns1,dns2)

for each objnetadapter in colnetadapters

errenable = objnetadapter.enablestatic(stripaddress, strsubnetmask)

errgateways = objnetadapter.setgateways(strgateway, strgatewaymetric)

errdns=objnetadapter.setdnsserversearchorder(arrdnsservers)

next

set objwmiservice = getobject("winmgmts:" _

& "!\\" & strcomputer & "\root\cimv2")

set colcomputers = objwmiservice.execquery _

("select * from win32_computersystem")

for each objcomputer in colcomputers

'objcomputer.rename(num&name)

next

set objnetworksettings = objwmiservice.get("win32_networkadapterconfiguration")

objnetworksettings.setipxvirtualnetworknumber(num)

vb讀取登錄檔

2樓:匿名使用者

'現提供**如下:

'請查收。

dim s as string

s= createobject("wscript.shell") .regread("hkey_local_machine\software\tencent\qq\install")

if s="" then then

msgbox "沒有找到qq安裝路徑!"

else

text1.text =s

endif

3樓:木子不

我給你個.net的吧,不知道你用的什麼版本dim svalue as string

svalue = my.computer.registry.

getvalue("hkey_local_machine\software\tencent\qq", "install", nothing)

if svalue is nothing then msgbox("找不到這項!")

上面那位的**也要加一下:

if text1.text is nothing then msgbox("找不到這項!")

4樓:匿名使用者

private sub command1_click()dim w as object

on error goto err

set w = createobject("wscript.shell")

text1.text = w.regread("hkey_local_machine\software\tencent\qq\install")

exit sub

err:

err.clear

msgbox "找不到這個值"

exit sub

end sub

5樓:匿名使用者

vb中函式在沒有指定返回變數(call可以) 不可以加括號

6樓:手機使用者

你不會是想編寫通過刪除桌面上的qq快捷方式,再生成自己的快捷方式以達到執行自己的病毒吧?!

vb 如何設定讀取密碼在ini文字中

應該這下面合適你的要求了。private sub command1 click if dir f password.ini then open f password.ini for input as 1 line input 1,mima close 1 if text1.text mima the...

vb程式設計,關於查詢檔案匹配行後再讀取幾行資料的問題,求高手解答

private sub mand1 click dim id as string dim lenth as integer open c documents and settings administrator 桌面 1.txt for input as 1 do while not eof 1 l...

VB資料庫問題,用vb做資料庫,打包時遇見問題

這是excel做的。dim oleexcel as object dim s as string private sub command3 click 存xls dim i,j as integer false false表示excel窗體隱藏。開啟檔案。filename 從xls檔案中讀內容。s ...