下面我们来看一下到底是怎么回事,你刚才拷贝的那些dll文件其实是我使用Visul
Basic5开发的一个主件:
1,打开VB5新建一个“ActiveX.dll”文件,吧下面的代码输入进去:
Private Declare Function ExitWindowsEx Lib
"user32"_
(ByVal
uFlags As Long,ByVal dwReserved As Long)_
As Long
Sub Xuankong() "请不要加上“private”
a$=InputBox("请输入你的姓名,如果你输入的是"xuankong""+Chr(13)+Chr(10)+
"则会在你的系统中生成一个"xuankong"文件"+Chr(10)+Chr(13)+
"否则你的机器可能会重起","请输入","xuankong")
If a$="xuankong" Then
Open "c:\xuankong.dat" For Append As #Write#1,"我的朋友,这是一个asp主件测试程序"
#Write#1,"hello world!this is a test"
#Write#1,"如果你看到这个文件测试就成功!"
else
ExitWindowsEx&H43,0使用API函数重新启动机器
End if
Close #1
End sub
2,把工程名改为dll,类模块改为test,然后把这个工程生成dll文件到c:\windows\system目录下面。
3,新建一个index.asp文件下面的代码输入进去:
$#@60;html$#@62;$#@60;head$#@62;$#@60;title$#@62;这是一个关于asp主件的测试$#@60;/title$#@62;$#@60;/head$#@62;
$#@60;body$#@62;
$#@60;% set rs=server.createobject("dll.test") %$#@62;
$#@60;% set rs1=rs.xuankong rs1.execute %$#@62;
$#@60;/body$#@62;
$#@60;/html$#@62;
4,拷贝index.asp到你的服务器内,按照上面的方法调试!