ASP멕좋잚

2018-09-06 13:14

阅读:505

  릿齡덜쯤 덜쯤흔苟:
ClassWyd_AspCodeHighLight
PrivateRegEx
PublicKeyword,ObjectCommand,Strings,VBCode
PublicKeyWordColor,ObjectCommandColor,StringsColor,Comment,CodeColor
PrivateSubClass_Initialize()
SetRegEx=NewRegExp
RegEx.IgnoreCase=True?阮초퓐舟扁虜靈링캑僭∠?nbsp;True꼇혐롸。
RegEx.Global=True?阮쳰コ坰棟伽?
KeyWordColor=#0000FF
ObjectCommandColor=#FF0000
StringsColor=#FF00FF
Comment=#008000
CodeColor=#993300
Keyword=SetPrivateIfThenSubEndFunctionForNextDoWhileWendTrueFalseNothingClass밑쉔俚헝菱성警속
ObjectCommand=LeftMidRightIntCintClngStringJoinArray변鑒헝菱성警속
VBCode=
EndSub
PrivateSubClass_Terminate()
SetRegEx=Nothing
EndSub
PrivateFunctionM_Replace(Str,Pattern,Color)
RegEx.Pattern=Pattern?阮쳐J숯?
M_Replace=RegEx.Replace(Str,<fontcolor=&Color&>$1</font>)
EndFunction
PrivateFunctionString_Replace(Str,Pattern,Pattern1,Color,IsString)
DimTemp,RetStr
RegEx.Pattern=Pattern1
SetMatches=RegEx.Execute(Str)
ForEachMatchInMatches깁저Matches섞북
Temp=Re(Match.value)
Str=Replace(Str,Match.value,Temp)
Next
RegEx.Pattern=Pattern?阮쳐J숯?
IfIsString=1Then
String_Replace=RegEx.Replace(Str,<fontcolor=&Color&>$1</font>)
Else
String_Replace=RegEx.Replace(Str,<fontcolor=&Color&>$1</font>)
EndIf
EndFunction
PrivateFunctionRe(Str)
DimTRegEx,Temp
SetTRegEx=NewRegExp
TRegEx.IgnoreCase=True?阮초퓐舟扁虜靈링캑僭∠뇟?
TRegEx.Global=True?阮쳰コ坰棟伽?
TRegEx.Pattern=<.*?>
Temp=TRegEx.Replace(Str,)
Temp=Replace(Temp,<,)
Temp=Replace(Temp,>,)
Re=Temp
SetTRegEx=Nothing
EndFunction
PublicFunctionMakeLi()
DimTemp
IfVBCode=Then
MakeLi=
ExitFunction
EndIf
VBCode=HTMLEncode(VBCode)
Temp=M_Replace(VBCode,\b(&Keyword&)\b,KeyWordColor)
Temp=M_Replace(Temp,\b(&ObjEctCommand&)\b,ObjectCommandColor)
Temp=String_Replace(Temp,(.*?),(.*)(<.+?>)(&KeyWord&ObjectCommand&)+(<.+?>)(.*),StringsColor,1)俚륜눔
Temp=String_Replace(Temp,((rem).*),(.*)(<.+?>)(&KeyWord&ObjectCommand&)+(<.+?>)(.*),Comment,0)鬧姦
MakeLi=<FONTCOLOR=&CodeColor&>&RepVbCrlf(Temp)&</FONT>
EndFunction
PublicFunctionRepVbCrlf(fString)
RepVbCrlf=Replace(fString,CHR(10),<BR>)
EndFunction
PublicFunctionHTMLEncode(fString)
IfIsNull(fString)OrfString=Then
HTMLEncode=
ExitFunction
EndIf
fString=replace(fString,>,>)
fString=replace(fString,<,<)
fString=Replace(fString,CHR(32),)
fString=Replace(fString,CHR(9),)
fString=Replace(fString,CHR(34),)
fString=Replace(fString,CHR(39),)
fString=Replace(fString,CHR(13),)
fString=Replace(fString,CHR(10)&CHR(10),</P><P>)
fString=Replace(fString,CHR(10),<BR>)
HTMLEncode=fString
EndFunction
EndClass

절綾
star=timer()
SetTT=NewWyd_AspCodeHighLight
IfRequest(xx)<>Then
TT.VBCode=Request(xx)
Response.writeTT.MakeLi()
REsponse.write<br>&FormatNumber(timer()-star,2)*1000
Else
%>
<FORMMETHOD=POSTaction=Index2.asp>
<TEXTAREANAME=xxROWS=30COLS=80>ClassLih
PrivateRegEx
PublicKeyword,ObjectCommand,Strings,VBCode
PublicKeyWordColor,ObjectCommandColor,StringsColor,Comment
PrivateSubClass_Initialize()
SetRegEx=NewRegExp
KeyWordColor=#0000FF
ObjectCommandColor=#FF0000
StringsColor=#FF00FF
Comment=#008000
Keyword=IfEndForNextFunctionThenDoWhileWendClass
VBCode=
EndSub
PrivateSubClass_Terminate()
SetRegEx=Nothing
EndSub
PrivateFunctionM_Replace(Str,Pattern,Color)
RegEx.IgnoreCase=False?阮초퓐舟扁虜靈링캑僭∠뇟?
RegEx.Global=True?阮쳰コ坰棟伽?
RegEx.Pattern=Pattern?阮쳐J숯?lt;/TEXTAREA>
<INPUTTYPE=submitvalue=fff>
</FORM>
<%
EndIf
%>


评论


亲,登录后才可以留言!