ASP能讀寫注冊表
發(fā)表時間:2024-02-03 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]一個例子: <%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>