惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 吕艳阳

asp.net 重新启动应用程序 eWebEditor在线文本编辑器最新版(V4.6) 用DataReader 分页与几种传统的分页方法的比较 CodeSmith实体类模板 Oracle中取余的方法 (转)C#新特性:可空类型 (转)asp.net自定义控件(数据绑定) (转)asp.net控件设计时支持(3) javascript事件列表解说 返回数据库内所有表的字段 网线水晶头的接法 Access密码破解工具 简单介绍一下asp.net中DataGrid的使用(视频教程) Asp.net中文件的上传和下载(视频教程) 操作系统常用技巧 Oracle9i 用户登录存储过程 Oracle 冷备份操作 Oralce9i 获取单个字段的值 Oracle 9i 返回一个记录集的方法
如何在asp中,使用vb来开发dll组件 (提供视频下载)
吕艳阳 · 2008-09-18 · via 博客园 - 吕艳阳


               今天给大家讲解一下如何在asp中,使用vb来开发dll组件
                           (下次讲解在vc++中来开发)

视频下载

1.新建文件夹 aspdll
2.新建文件 test.asp (<%=now()%>)
3.设置文件夹共享
4.测试一个简单的asp页面

http://localhost/aspdll/test.asp

没有问题


5.打开vb,新建 ActiveX DLL工程

添加引用:
Project --- references 
选择
Microsoft Active Server Pages Object Library
如果要使用数据库,就是ado对象 还要添加下面一个引用
Microsoft ActiveX Data Objects 2.6 Library


6.为了方便使用asp中的6大对象,我们要添加下面的一段话,一会我给大家解释

Option Explicit  '意思是: 要使用变量就必须要声明,默认情况下vb中使用变量是不用声明的
                 '为了程序的机构以及执行的速度,我们尽量声明变量,再使用变量

'声明对象,这些对象就是我们在asp中经常使用的6大对象
'这里做声明主要是方便在vb中方便的使用asp内置的6大对象
Private Context As ScriptingContext
Private Application As Application
Private Response As Response
Private Request As Request
Private Session As Session
Private Server As Server

'当一个页面加载的时候执行
'这里主要是用来创建对象的
Public Sub OnStartPage(PassedscriptContext As ScriptingContext)
Set Context = PassedscriptContext
Set Application = Context.Application
Set Request = Context.Request
Set Response = Context.Response
Set Server = Context.Server
Set Session = Context.Session
End Sub


'当这个页面卸载的时候执行
'这里主要是用来销毁对象的
Public Sub OnEndPage()
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
Set Context = Nothing

End Sub

7.写一个函数

DllTest.AspDll


Public Function DllTest()
Response.Write ("现在时间是:" & Now())
End Function

现在我给大家解释一下代码

8 对应的asp文件的写法
<%

'set zujian = server.createobject("工程名称.类名称")
set zujian = server.createobject("DllTest.AspDll")
zujian.DllTest
%>

9.调试
 右键工程 -- 工程属性  -- 调试

选择start browser with URl:
http://localhost/aspdll/test.asp

10 运行,......................


ok
没有问题


11.发布
File -- Make dll
选择一个路径,这样我们的动态链接库就ok了
那么我们怎么使用呢

12 给系统注册
regsvr32 DllTest.dll

卸载组件  regsvr32 /u DllTest.dll

ok 这样我们的组件就做好了,
如果你要修改组件,必须重新启动iis,才能生效

好了,朋友们再见!

视频下载