html5/css教程

javascript教程

asp教程

php教程

jsp教程

C#/.NET教程

Python教程

网络营销

建站经验

点击排行

您现在的位置:首页 > 网络教程 > asp技巧

ASP读取和写入注册表的方法

来源:中文源码网    浏览:522 次    日期:2024-04-24 09:52:02
一个例子: 
<%Dim readpcname 
Set readpcname=CreateObject("WScript.Shell") 
Dim ComputerName,pathreg 
pathreg="HKLMSystemCurrentControlSetControlComputerNameComputerNameComputerName" 
ComputerName=readpcname.RegRead(pathreg) 
response.write "计算机名为"&ComputerName %> 

第二个读的代码 

<% 
Dim pathreg 
pathreg=request.form("pathreg") 
if pathreg<> "" then 
pathreg = "HKLMSOFTWAREMICROSOFTWINDOWSCURRENTVERSIONCOMMONFILESDIR" 
Set objShell = CreateObject("WScript.Shell") 
Response.Write objShell.RegRead(pathreg) 
end if 
%> 
注册表键值

精彩推荐