对VB/ASP源代码进行着色
这类程序在网上很多,但拿来练练“正则表达式”也不错的,所以就随手写了这个,现在只能对代码(函数,关键字,对象,字符串)进行着色,下一步想对函数块加入折叠效果(.NET代码编辑器的效果)。演示效果代码:(ChangeVBToColor函数即是重点函数)
---------------------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
font-family: "宋体";
font-size: 12px;
color: #333333;
}
.Text {
font-family: "宋体";
font-size: 12px;
border: 1px solid #333333;
}
td {
font-family: "宋体";
font-size: 12px;
}
-->
</style>
</head>
<body>
<table width="760" height="399" border="0" cellpadding="0" cellspacing="2">
<tr>
<td height="302" valign="top"><form name="form1" method="post" action="">
<div align="center">
<textarea name="Content" cols="120" rows="25" class="Text" id="Content"></textarea> <br>
<input name="btnShow" type="button" class="Text" id="btnShow" value="显 示" OnClick="GetHtmlContent()">
</div>
</form></td>
</tr>
<tr>
<td height="91"><span id="sHtml"></span></td>
补充:asp教程,脚本编码