VBS、ASP代码语法加亮显示的类(2)

2016-01-29 20:22 9 1 收藏

VBS、ASP代码语法加亮显示的类(2),VBS、ASP代码语法加亮显示的类(2)

【 tulaoshi.com - ASP 】

<!--#include file="token.asp"--
<% ' *************************************************************************
' This is all test/example code showing the calling syntax of the
' cBuffer class ... the interface to the cBuffer object is quite simple.
'
' Use it for reference ... delete it ... whatever.
' *************************************************************************

REM This is a rem type comment just for testing purposes!

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/asp/)

' This variable will hold an instance of the cBuffer class
Dim objBuffer

' Set up the error handling
On Error Resume Next

' create the instance of the cBuffer class
Set objBuffer = New cBuffer

' Set the PathToFile property of the cBuffer class
'
' Just for kicks we'll use the asp file that we created
' in the last installment of this article series for testing purposes
objBuffer.PathToFile = "../081899/random.asp" '这是文件名啦。

' Here's an example of how to add a new keyword to the keyword array
' You could add a list of your own function names, variables or whatever...cool!
' NOTE: You can add different HTML formatting if you like, the <strong
' attribute will applied to all keywords ... this is likely to change
' in the near future.
'
'objBuffer.AddKeyword "response.write", "<font color=RedResponse.Write</font"

' Here are examples of changing the table background color, code color,
' comment color, string color and tab space properties
'
'objBuffer.TableBGColor = "LightGrey" ' or
'objBuffer.TableBGColor = "#ffffdd" ' simple right?
'objBuffer.CodeColor = "Red"
'objBuffer.CommentColor = "Orange"
'objBuffer.StringColor = "Purple"
'objBuffer.TabSpaces = " "

' Call the ParseFile method of the cBuffer class, pass it true if you want the
' HTML contained in the page output or false if you don't
objBuffer.ParseFile False '注意:显示代码的response.write已经在class中。这里调用方法就可以了。


' Check for errors that may have been raised and write them out
If Err.number < 0 Then
Response.Write Err.number & ":" & Err.description & ":" & Err.source & "<br"
End If

' Output the processing time and number of lines processed by the script
Response.Write "<strongProcessing Time:</strong " & objBuffer.ProcessingTime & " seconds<br"
Response.Write "<strongLines Processed:</strong " & objBuffer.LineCount & "<br"

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/asp/)

' Destroy the instance of our cBuffer class
Set objBuffer = Nothing
%

来源:http://www.tulaoshi.com/n/20160129/1511080.html

延伸阅读
不过VB.NET确实有许多VB6没有的新功能,代码的自动排版就是一项,这也正是我们今天要实现的功能——VB代码格式化。 先看下实现的效果: 格式化前: 代码如下: For i = 0 To WebBrowser1.Document.All.length - 1 If WebBrowser1.Document.All(i).tagName = "HTML" Then strContent = strContent & WebBrowser1.Document.All(i).innerH...
标签: ASP
  */ASP+ 现在支持两种语言C# (简称 "C Sharp"), Visual Basic, and JScript. 基于习惯,在以下的语言介绍中,我们采用的练习和例程采用VB和C#语言来开发Web应用程序.如果想要得到关于.Net技术的详细资 料,请去MS的站点 查看关于 NGWS SDK! 在下面的列表中,你可以看到关于这两种语言的语法的简要介绍 1.变量声名 C# 语法 int...
标签: Web开发
项目中需要用到日历,.net的日历控件又太重,只好用js写一个,日历的核心函数是 DateAdd(),编写过程中发现 js 里面操作时间比想象中的繁琐,不像vbscript中的可以轻松地dateadd,后来才想到用 setFullYear()、setDate()等内置函数,可以拼合一个js版的 dateadd() 来,代码如下: 代码如下: function Da...
标签: Java JAVA基础
隐藏注释 写在JSP程序中,但不是发给客户。 JSP 语法 <%-- comment --% 例子: <%@ page language="java" % <html <head<titleA Comment Test</title</head <body <h2A Test of Comments</h2 <%-- This comment will not be visible in the page source --% </body </html 描述 用隐藏...
标签: Web开发
升级到第二版,开一贴以示庆贺,哈哈哈 自 Ver1.1 升级内容 1. 增加函数列表 2. 增加函数 Export 功能 3. 增加函数依存关系分析 (这个功能个人未见其他软件实现过,自己创意,问题多多,目前分析能力还是比较有限的,只能分析全局函数依存关系,可能在复杂代码的情况下出现 bug) 4. ...

经验教程

467

收藏

68
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部