当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: ASP提速技巧五则 技巧之一:提高使用Request集合的效率 访问一个ASP集合来提取一个值是费时的、占用计算资源的过程。
 

 

 ·ado操作及其参数介绍     »显示摘要«
    摘要:ado操作及其参数介绍  1. asp与access数据库连接:<%@ language=vbscript%><%dim conn,mdbfilemdbfile=server.mappath("数据库名称.mdb")set conn=server.createobject("adodb.connection")conn.open &quo......
 ·asp,fso遍历目录及目录下文件    »显示摘要«
    摘要:asp,fso遍历目录及目录下文件  <%@ language=vbscript %><% ´我写的一个遍历目录以及目录下文件的函数,%><%  function bianli(path)    set fso=server.createobject("scripting.filesystemobject")      on erro......


ASP提速技巧五则
asp提速技巧五则

  技巧之一:提高使用request集合的效率 【程序编程相关:Shell编程(1)- 文件安全与权限

【推荐阅读:WINXp下配置apache2.0.52

访问一个asp集合来提取一个值是费时的.占用计算资源的过程.因为这个操作包含了一系列对相关集合的搜索,这比访问一个局部变量要慢得多.因此,如果打算在页面中多次使用request集合中的一个值,应该考虑将其存贮为一个局部变量.例如将代码写成下面的形式以加快脚本引擎处理速度: 【扩展信息:安装SAP的一些心得经验

strtitle=request.form("title")

strfirstname=request.form("firstname") 

strlastname=request.form("lastname") 

if len(strtitle) then strtitle=strtitle & " " 

if strfirstname="" then strfullname=strtitle & " " & strlastname 

elseif len(strfirstname)=1 then

strfullname=strtitle & strfirstname & ". " & strlastname

else

strfullname=strtitle & strfirstname & " " & strlastname 

end if

技巧之二:直接访问适当的集合

如果不是别无选择,否则不要使用strpage=request("page")的这样的形式来获取参数,因为这将按顺序搜索全部的集合—querystring.form.cookies.clientcertificate.servervarible直到发现第一个匹配值的名称.
...   下一页
 ·asp ,ip地址分段计算    »显示摘要«
    摘要:asp ,ip地址分段计算   <script language="jscript" runat="server"> function ipdecode(eip){ var ip1,ip2,ip3,ip4; ip1 = movebyter(eip & 0xff000000,3); ip2 = movebyter(eip & ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE