利用ASP在客户端注册DLL文件

ClientRegDLL.html

本 程 式 方 法 介 绍 利 用 客 户 端 注 册 DLL 文 件。
下 一 回 讲 解 客 户 端 如 何 获 得 DLL 文 件。

 1<html>
 2<head id="head1">
 3<meta content="text/html charset=gb2312" http-equiv="Content-Type"/>
 4<title id="title">Client use asp to register the exist dll file</title>
 5</head>
 6<body bgcolor="skyblue" bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0">
 7<div align="center">
 8<table><tr><td>Client use asp to register the exist dll file</td></tr></table>
 9</div>
10<input language="vbscript" name="reg_dll" onclick="fun_reg()" type="button" value="Register dll"/>
11</body>
12</html>
 1<script language="vbscript">   
 2' we had produce the WebReport.dll file and place in the client   
 3'win <98 \windows\system\WebReport.dll   
 4'win 98 \windows\system32\WebReport.dll   
 5'win nt40 \winnt\system\WebReport.dll   
 6'win 2000 \winnt\system32\WebReport.dll   
 7sub fun_reg()   
 8Dim WshShell,fso   
 9Set WshShell = CreateObject("Wscript.Shell")   
10Set fso = CreateObject("Scripting.FileSystemObject")   
11  
12If fso.FileExists("\windows\system\WebReport.dll") Then   
13WshShell.run "regsvr32 /s \windows\system\WebReport.dll" , 1, true   
14msgbox "Register \windows\system\WebReport.dll file sucess!"   
15  
16elseIf fso.FileExists("\windows\system32\WebReport.dll") Then   
17WshShell.run "regsvr32 /s \windows\system32\WebReport.dll" , 1, true   
18msgbox "Register \windows\system32\WebReport.dll file sucess!"   
19  
20elseIf fso.FileExists("\winnt\system\WebReport.dll") Then   
21WshShell.run "regsvr32 /s \winnt\system\WebReport.dll" , 1, true   
22msgbox "Register \winnt\system\WebReport.dll file sucess!"   
23  
24elseIf fso.FileExists("d:\winnt\system32\WebReport.dll") Then   
25WshShell.run "regsvr32 /s d:\winnt\system32\WebReport.dll" , 1, true   
26msgbox "Register d:\winnt\system32\WebReport.dll file sucess!"   
27else   
28msgbox "Not found the register dll file!"   
29end if   
30set fso=nothing   
31set WshShell=nothing   
32  
33end sub   
34</script>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus