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

2016-01-29 20:22 3 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.
' *************************************************************************

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

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

(本文来源于图老师网站,更多请访问https://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中。这里调用方法就可以了。

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


' 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"

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

来源:https://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开发
代码如下: Class Wyd_AspCodeHighLight Private RegEx Public Keyword,ObjectCommand,Strings,VBCode Public KeyWordColor,ObjectCommandColor,StringsColor,Comment,CodeColor  Private Sub Class_Initialize()    Set RegEx = New RegExp RegEx.IgnoreCase&nb...
标签: Web开发
严格地说,ASP 并不是一门编程语言,所以不存在类这一概念,我们这里说 ASP 类是指 ASP 的编程语言 VBScript 在 ASP 里应用时的类。 ASP 类比较简单,它不具有真正意义类的继承、重载等特性,尽管如此,它仍然是非常有用的,它降低了我们编程的复杂度,使我们的程序模块更加合理。 ASP&nbs...
标签: ASP
  ASP+ 现在支持两种语言C# (简称 "C Sharp"), Visual Basic, and JScript. 基于习惯,在以下的语言介绍中,我们采用的练习和例程采用VB和C#语言来开发Web应用程序.如果想要得到关于.Net技术的详细资料,请去MS的站点 查看关于 NGWS SDK! 在下面的列表中,你可以看到关于这两种语言的语法的简要介绍 1.变量声名 C# 语法 in...

经验教程

265

收藏

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