һֱ˵aspԵЧʵͣʵȻЧʵֻdzԱڿĹеķЧʵͶѣЧʵûйϵ
ʵʿУҷaspһЧʵ͵ĵط&ӷЧʵͣǻҲֱЧʡDZȽһַ
<%
class strCat
Private index, ub, ar()
Private Sub Class_Initialize()
'statements
redim ar(50)
index=0
ub=10
End Sub
Private Sub Class_Terminate()
'statements
erase ar
End Sub
public default Sub Add(value)
ar(index)=value
index=index+1
if index>ub then
ub=ub+50
redim preserve ar(ub)
end if
end sub
public Function display
redim preserve ar(index-1)
display=join(ar,"")
end function
end class
'һʹ&ӷ
t1=timer
os=""
for i=1 to 10000
os=os & "www.aspbc.com"&i&" "
next
s=os
t2=timer
response.Write("
Using the fast string class: " &t2-t1 & "
")
'ʹԶ
t3=timer
set cat= new strCat
for i=1 to 10000
cat("www.aspbc.com")
next
s= cat.display
set cat = nothing
t4=timer
response.Write("
Using the fast string class: " &t4-t3 & "
")
%>
- 'гҪ롣[ȡSQLά UserInfo ]
- 'UserInfo = 0 ID,1 SV_ID,2 RECORD,3 Province,4 City,5 Name,6 Sex,7 Address,8 PostCode,9 Phone,10 OtherInfo,11 UserName,12 IP,13 DateTime
- Dim OutputText 'ı
- Dim SurveyInfo 'Ϣ
- Dim TempItemText 'ʱмַӱ(*ؼ)
- '.
- For i=0 To UBound(UserInfo,2)
- TempItemText = TempItemText & (VbCrLf & "" & UserInfo(5,i) & VbCrLf & _
- "ʡݣ" & UserInfo(3,i) & " У" & UserInfo(4,i) & VbCrLf & _
- "ϵַ" & UserInfo(7,i) & " ʱࣺ" & UserInfo(8,i) & VbCrLf & _
- "绰" & UserInfo(9,i) & VbCrLf)
-
- ' [OtherInfo ûϵĴ,ͬҪ 0 OutputText ]
- TempItemText = TempItemText & ("IP" & UserInfo(12,i) & " Time:" & UserInfo(13,i) & VbCrLf & _
- "------------------------------------------------------------" & VbCrLf)
- '10ַ
- If ((i+1) Mod 10) =0 Then
- OutputText = OutputText & TempItemText
- TempItemText = ""
- End If
- Next
- If TempItemText<>"" Then
- OutputText = OutputText & TempItemText
- End If
ԿһмTempItemTextÿûϣֱӼOutputText3ͨ i 10ȡԼÿ10ûһOutputTextٴμ10Nextһܵ<10ûϽд OutputTextӡܹŻ15OutputTextӡ
ûʹStringBuilder£Ż0.7sĿҪ
ܽһñʽȼٶԴַӴ(һţԭӰ*Ƽ)
СַмٶԴַӴ
Ż÷ΧASP(C#)