<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>VBScript版代碼高亮</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="menu_head">VBScript版代碼高亮</div>
<div class="content">
<script language="vbscript" type="text/vbscript">
'======================================
'代碼高亮類
'使用方法:
'Set HL = New Highlight '定義類
'HL.Language = "vb" '指定程序語言,支持 VBS ,JS ,XML, HTML, SQL, C#, Java...等
'還可通過直接設(shè)置下列屬性還設(shè)置相關(guān)關(guān)鍵字等
' Public Keywords '關(guān)鍵字
' Public Objects '對象
' Public SplitWords '分隔符
' Public LineComment '行注釋
' Public CommentOn '多行注釋
' Public CommentOff '多行注釋結(jié)束
' Public Ignore '是否區(qū)分大小寫
' Public CodeContent '代碼內(nèi)容
' Public Tags '標記
' Public StrOn '字符串標記
' Public Escape '字符串界定符轉(zhuǎn)義
' Public IsMultiple '允許多行引用
'HL.CodeContent = "要高亮的代碼內(nèi)容"
'Response.Write(Hl.Execute) '該方法返回高亮后的代碼
'=====================================
Class Highlight
Public Keywords '關(guān)鍵字
Public Objects '對象
Public SplitWords '分隔符
Public LineComment '行注釋
Public CommentOn '多行注釋
Public CommentOff '多行注釋結(jié)束
Public Ignore '是否區(qū)分大小寫
Public CodeContent '代碼內(nèi)容
Public Tags '標記
Public StrOn '字符串標記
Public Escape '字符串界定符轉(zhuǎn)義
Public IsMultiple '允許多行引用
Private Content
Private Sub Class_Initialize
Keywords = "function,void,this,boolean,while,if,return,new,true,false,try,catch,throw,null,else,int,long,do,var" '關(guān)鍵字
Objects = "src,width,border,cellspacing,cellpadding,align,bgcolor,class,style,href,type,name,String,Number,Boolean,RegExp,Error,Math,Date" '對象
SplitWords = " ,.?!;://<>(){}[]""'=+-|*%@#$^&"&VBCRLF&CHR(9) '分隔符
LineComment = "http://" '行注釋
CommentOn = "/*" '多行注釋
CommentOff = "*/" '多行注釋結(jié)束
Ignore = 0 '是否區(qū)分大小寫
Tags = "a,img,html,head,body,title,style,script,language,input,select,div,span,button,img,iframe,frame,frameset,table,tr,td,caption,form,font,meta,textarea" '標記
StrOn = """'" '字符串標記
新聞熱點
疑難解答
圖片精選