VBS、ASP代码语法加亮显示的类
2024-05-04 11:06:16
供稿:网友
<% class cbuffer
private objfso, objfile, objdict
private m_strpathtofile, m_tablebgcolor, m_starttime
private m_endtime, m_linecount, m_intkeymin, m_intkeymax
private m_codecolor, m_commentcolor, m_stringcolor, m_tabspaces
private sub class_initialize()
tablebgcolor = "white"
codecolor = "blue"
commentcolor = "green"
stringcolor = "gray"
tabspaces = " "
pathtofile = ""
m_starttime = 0
m_endtime = 0
m_linecount = 0
keymin = 2
keymax = 8
set objdict = server.createobject("scripting.dictionary")
objdict.comparemode = 1
createkeywords
set objfso = server.createobject("scripting.filesystemobject")
end sub
private sub class_terminate()
set objdict = nothing
set objfso = nothing
end sub
public property let codecolor(incolor)
m_codecolor = "<font color=" & incolor & "><strong>"
end property
private property get codecolor()
codecolor = m_codecolor
end property
public property let commentcolor(incolor)
m_commentcolor = "<font color=" & incolor & ">"
end property
private property get commentcolor()
commentcolor = m_commentcolor
end property
public property let stringcolor(incolor)
m_stringcolor = "<font color=" & incolor & ">"
end property
private property get stringcolor()
stringcolor = m_stringcolor
end property
public property let tabspaces(inspaces)
m_tabspaces = inspaces
end property
private property get tabspaces()
tabspaces = m_tabspaces
end property
public property let tablebgcolor(incolor)
m_tablebgcolor = incolor
end property
private property get tablebgcolor()
tablebgcolor = m_tablebgcolor
end property
public property get processingtime()
processingtime = second(m_endtime - m_starttime)
end property
public property get linecount()
linecount = m_linecount
end property
public property get pathtofile()