明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

ASP能讀寫注冊表

[摘要]一個例子: <%Dim ReadComputerName Set ReadComputerName=CreateObject("WScript.Shell") Dim ComputerName,RegPath RegPath="HKLM\System\Curre...
 一個例子:
<%Dim ReadComputerName
Set ReadComputerName=CreateObject("WScript.Shell")
Dim ComputerName,RegPath
RegPath="HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
ComputerName=ReadComputerName.RegRead(RegPath)
response.write "計算機名為"&ComputerName %>

第二個讀的代碼

<%
Dim zcbpath
zcbpath=request.form("zcbpath")
if zcbpath<> "" then
'zcbpath = "HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\COMMONFILESDIR"
Set objShell = CreateObject("WScript.Shell")
Response.Write objShell.RegRead(zcbpath)
end if
%>
<form action="zcb.asp" method=post>
注冊表鍵值<input type=text name=zcbpath id=zcbpath>
<input type=submit>
</form>