网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.Asp.net(c#)数据库操作类.
.使用命名管道访问SQL Server.
.ASP实现多语言支持.
.如何实现动态添加Html文档中Form.
.改进性能和样式的 25+ ASP 技巧(.
.ASP取出HTML里面的图片地址的函数.
.灵活实用的页面广告实例.
.利用ASP实现事务处理的方法.
.Microsoft IIS 真的如此「不安全.
.支持多风格变换的ASP分页类.
.如何使用context()方法将数据置入.
.表单递交合法性检测-Email .
.在 Access 中使用“存储过程”.
.ASP Error '0115'的一些解决办法.
.ASP对FoxPro自由表(DBF文件)的操.
.关于recordcount等-1的问题.
.在Form域中Post大于100K的数据 .
.用AspJpeg组件,按宽高比例,真正.
.不用EOF以加快记录循环.
.ASP日期和时间函数示例.

不用组件来实现StrCat函数的功能

发表日期:2001-1-3


really really slow by nature. This sample code uses classes to speed up the process by ten times. Someone recentally came up with a DLL to do this but not all of us can install a DLL on our ISP's web servers so I wrote this easy to use VB Class for handling string concatenation.

code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!


Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.  


    '**************************************
    ' Name: StrCat - Non DLL version
    ' Description:ASP's ability to concatena
    '     ting many strings together is really rea
    '     lly slow by nature. This sample code use
    '     s classes to speed up the process by ten
    '     times. Someone recentally came up with a
    '     DLL to do this but not all of us can ins
    '     tall a DLL on our ISP's web servers so I
    '     wrote this easy to use VB Class for hand
    '     ling string concatenation.
    ' By: Kevin Pirkl
    '
    ' Inputs:Public Property Length - To res
    '     ize the string length. To use it a secon
    '     d time on another string just set the .L
    '     ength property to another value or just
    '     dereference the object and recreate it.
    Public Method Add - too add data to the concatenated string.
    '
    ' Assumes:Didnt do much testing except u
    '     sing it to add together a string of 100,
    '     000 characters and it took about 7 secon
    '     ds which is not bad. If you need to add
    '     together more than that dont use this. I
    '     f your catting char strings like "<TR
    '     >" + whatever then it should be ok.
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/xq/ASP/txtCode
    '     Id.6342/lngWId.4/qx/vb/scripts/ShowCode.
    '     htm    'for details.    '**************************************
    
    Set X = New strCat' Create an instance of strCat
    X.Length = 100001' Change from the default String length of 100,000
    str = ""
    For I = 1 To X.Length
     X.Add("A") '- takes 7 seconds on my computer
     'str = str & "A"'- takes 1 minute 7 seconds on my computer
    Next
    msgBox(Len(X.Value))
    X.Length = 101
    For I = 1 To X.Length
     X.Add("B")
    Next
    msgBox(Len(X.Value))
    Set X = Nothing ' Destroy the instance.
    msgBox("Done")
    Class strCat
     Private IntCntr
     Private strArray()
     Private intLength
     Public Property Get Length
     Length = intLength
     End Property
     Public Property Let Length( ByVal intLen)
     intLength = intLen
     IntCntr = 0
     Redim strArray(1)
     strArray(0) = ""
     Redim strArray(intLength)
     End Property
     Public Property Get Value
     Value = Join( strArray,"")
     End Property
     Private Sub Class_Initialize()
     IntCntr = 0
     Length = 100000
     End Sub
     Public Function Add( strToAdd)
     strArray(IntCntr) = strToAdd
     IntCntr= IntCntr + 1
     End Function
    End Class

上一篇:如何把ASP编写成DLL  人气:12440
下一篇:不用java的垂直滚动看板 人气:9805
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐