關于ASP讀寫注冊表的實例分享
作者: 來源: 發布時間:2011-6-10 15:06:04 點擊:
下面提供的是關于ASP讀寫注冊表的實例,希望對初學ASP的朋友們有所幫助。
一個例子:
<%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>
[收藏此文章]