把ASP用DLL来写的原因:
1、代码保护
ASP的代码是在交付客户的时候是完全被暴露的。相对的保密性没有。市场上出现了很多对Asp加密的产品,但是在起到保护代码的作用的同时,运行速度被降低了,而且也不便于二次开发和管理。而ActiveX DLL完全可以实现Asp能做的所有工作,而且成品是经过编译的DLL文件,这样只把成品交付客户即可,自己的技术得到了很好的保护。
2、运行高效
这一点单凭滔滔不绝的说是没用的!
下面的代码可以证明这个!
先来看看针对用VB来实现的一些必须的代码:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
好了,我认为注释写的还算可以啦……
直接证明速度上的优势啦,KKK~~~~~~~~~~
在VB里添加:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
再在Asp里写:
<%
<%
Response.Write "
" & Now() & "
"
Response.Flush
Set obj = server.CreateObject("DSclub.Imgcompose")
obj.Count
Set obj = Nothing
Response.Write "
" & Now() & "
"
Response.Flush
%>Response.Write "<br/>" & Now() & "<br/>"
Response.Flush
Set obj = server.CreateObject("DSclub.Imgcompose")
obj.Count
Set obj = Nothing
Response.Write "<br/>" & Now() & "<br/>"
Response.Flush
%>
同样的代码功能用纯Asp来实现一下:
<%@ Language=VBScript %>
<%
Dim i,j
Response.Write "<br>" & Now() & "<br>"
Response.Flush
For i=0 to 10000000
j = j+2
next
Response.Write j
Response.Write "<br>" & Now() & "<br>"
Response.Flush
%>
<%@ Language=VBScript %><%
Dim i,j
Response.Write "
" & Now() & "
"
Response.Flush
For i=0 to 10000000
j = j+2
next
Response.Write j
Response.Write "
" & Now() & "
"
Response.Flush
%>
分别运行两个页面看结果:
靠,都不想说了
DLL的那个页面结果:
2004-7-10 15:41:48
20000002
2004-7-10 15:41:48
纯Asp的那个页面结果:
2004-7-10 15:41:38
20000002
2004-7-10 15:41:42
我的机器是
P42.8c 512M的
OS:windos XP
竟然差了这么多!!!
" & Now() & "
" Response.Flush Set obj = server.CreateObject("DSclub.Imgcompose") obj.Count Set obj = Nothing Response.Write "
" & Now() & "
" Response.Flush %><% Response.Write "
" & Now() & "
" Response.Flush Set obj = server.CreateObject("DSclub.Imgcompose") obj.Count Set obj = Nothing Response.Write "
" & Now() & "
" Response.Flush %><% Response.Write "
" & Now() & "
" Response.Flush Set obj = server.CreateObject("DSclub.Imgcompose") obj.Count Set obj = Nothing Response.Write "
" & Now() & "
" Response.Flush %><% Response.Write "
" & Now() & "
" Response.Flush Set obj = server.CreateObject("DSclub.Imgcompose") obj.Count Set obj = Nothing Response.Write "
" & Now() & "
" Response.Flush %><% Response.Write "
" & Now() & "
" Response.Flush Set obj = server.CreateObject("DSclub.Imgcompose") obj.Count Set obj = Nothing Response.Write "
" & Now() & "
" Response.Flush %><% Response.Write "
" & Now() & "
" Response.Flush Set obj = server.CreateObject("DSclub.Imgcompose") obj.Count Set obj = Nothing Response.Write "
" & Now() & "
" Response.Flush %>