Bir medit editörü ile fonksiyon kodlarını istediğiniz bir ASP dosyanızın içerisine ekleyin.Ya da sıfırdan bir dosya oluşturarak içerisine koyduktan sonra aşağıda vermiş olduğumuz örnek ile kodu çalıştırmaya başlayabilirsiniz:
<%=ColorCode(Metin)%>
<%
Public Function ColorCode(Code)
'|
'| Color Code
'| Coded By PsyChaos
'| A.K.A Semih Turna
'|
Code = Replace(Code,"<" +"%" ,"<" &"%" )
Code = Replace(Code,"%" +">" ,"%" &">" )
Set CodeTag = Server.CreateObject("Scripting.Dictionary" )
With CodeTag
.CompareMode = 3
.Add "<" &"%" , "%" &">" 'ASP
.Add "<" +"?" , "?" +">" 'PHP
End With
strColor = Array("#FFFF99" ,"#E4EEFD" ) 'Color Code
strBeginTag = CodeTag.Keys
strEndTag = CodeTag.Items
intCodeCount = CodeTag.Count - 1
For CT = 0 To intCodeCount
Code = Replace(Code,strBeginTag(CT), "<span style='background-color: " & strColor(CT) &"'>" & strBeginTag(CT),1,-1,1)
Code = Replace(Code,strEndTag(CT), strEndTag(CT) &"</span>" ,1,-1,1)
Next
Set CodeTag = Nothing
ColorCode = Code 'Replace(Code,vbCrlf,"
" )
End Function
%>


Alıntı ile Cevapla
Bu Konuyu Paylaşın !