用ASP读写注册表

来源:洛阳设计·中国 发布人:GuoBar 发布时间:2005-10-18 8:21:35 人气: 所属栏目: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 >




生成时间:2006-5-26 12:16:04