用vb6写asp组件的简单例子

本文介绍了解决本机调试问题的方法,包括通过重新启动www服务和注册DLL来解决问题,以及利用Microsoft Transaction Server (MTS)进行组件注册,提高网站服务器的安全性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本机调试
1、重新启动www服务
2、重新生成dll

服务器注册
1、手工注册DLL ,非常遗憾要重新启动服务器
regsvr32 RHasp.dll
反注册
regsvr32 /u RHasp.dll

2、另外还有一个方法可以不重新启动服务器
使用MTS(Microsoft Transaction Server)
MTS是IIS 4新增特色,但是它提供了巨大的改进。MTS允许你指定只有有特权的用
户才能够 访问组件,大大提高了网站服务器上的安全性设置。在MTS上注册组件的步骤如下:
(1) 打开IIS管理控制台。
(2) 展开transaction server,右键单击"pkgs installed"然后选择"new package"
(3) 单击"create an empty package"
(4) 给该包命名
(5) 指定administrator帐号或则使用"interactive"(如果服务器经常是使用administrator 登陆的话)
(6) 现在使用右键单击你刚建立的那个包下面展开后的"components"。选择 "new then component"
(7) 选择 "install new component"
(8) 找到你的.dll文件然后选择next到完成。

要删除这个对象,只要选择它的图标,然后选择delete.

参考例子
<%
‘调用的时候 server.createobject("工程名.类名")
set RHasp = server.CreateObject("RHasp.Functions")
RHasp.PrintInfo()
set RHasp = nothing
%>
'**********************************************
Private myScriptingcontext As ScriptingContext
Private myApplication As Application
Private myRequest As Request
Private myResponse As Response
Private myServer As Server
Private mySession As Session
'**********************************************

'*****************************************************************
Public Sub OnStartPage(passedscriptingcontext As ScriptingContext)
 Set myScriptingcontext = passedscriptingcontext
 Set myApplication = myScriptingcontext.Application
 Set myRequest = myScriptingcontext.Request
 Set myResponse = myScriptingcontext.Response
 Set myServer = myScriptingcontext.Server
 Set mySession = myScriptingcontext.Session
End Sub
'*****************************************************************

'*********************************
Public Sub OnEndPage()
 Set myScriptingcontext = Nothing
 Set myApplication = Nothing
 Set myRequest = Nothing
 Set myResponse = Nothing
 Set myServer = Nothing
 Set mySession = Nothing
End Sub
'********************************

Public Sub PrintInfo()
 myResponse.Write ("当前时间:" & Now())
End Sub
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值