VBScript编码规范格式

VBScript编码规范格式

代码规范:

1@ Language=VBScript 
1Option Explicit
1   
2'加入的文件   
 1   
 2'代码版权说明:   
 3'=========================================================   
 4' File: 文件名.asp   
 5' Version:1.0   
 6' Date:   
 7' Script Written by Tommy xiao   
 8' Description:   
 9'   
10' Revision:   
11' Date:   
12' Author:   
13' Description:   
14'=========================================================   
15' Copyright (C) 2003 Asiagame.Com. All rights reserved.   
16' Web:  http://www.advancededu.com    
17' Need help? Contact:  [email protected]    
18'=========================================================   
 1   
 2'容错机制代码   
 3'--------------------------------   
 4DIM NDEBUG_MSG   
 5NDEBUG_MSG=FALSE 
 6
 7IF NDEBUG_MSG = TRUE THEN   
 8'出错过滤   
 9ON ERROR RESUME NEXT   
10END IF 
11
12'变量声明及定义区   
13'Boolean error variant   
14Dim BlnFounderr,sErrmsg   
15BlnFounderr = FALSE   
16'触发错误信息   
17'sErrmsg=sErrmsg+"

<br/>

1"+"

<li>没有找到您需要的信息,欢迎使用。"
'BlnFounderr = TRUE

Dim oConn,oRs,sSQL 'ADO objects

'Set oConn = Server.CreateObject ("ADODB.Connection")
' oConn.Open Application("connStr")

'事务定义区

'输出错误
If BlnFounderr = TRUE Then
mError()
End If

'Func,Proc定义区
Function DealInput(exp1)
dim exp2 'Filter input for invalid characters
exp2=Replace(exp1,"&lt;","&lt;")
exp2=Replace(exp2,"&gt;","&gt;")
exp2=Replace(exp2,"'","''")
exp2=Replace(exp2,"&amp;","&amp;")
DealInput=exp2
End Function

Function CloseDatabase ' CloseDatabase
oConn.close
Set oConn = Nothing
End Function

sub mError()
'Response.Write sErrmsg&amp;"please contact system administrator."
response.write " <html>" &amp; vbCrLf
response.write " <head>" &amp; vbCrLf
response.write " <title>xxx站点--WEB后台管理</title>" &amp; vbCrLf
response.write " <meta 6.0""="" content="" generator""="" microsoft="" name="" studio="" visual=""/>" &amp; vbCrLf
response.write " <link css="" css""="" href="" index.css""="" rel="" stylesheet""="" text="" type=""/>" &amp; vbCrLf
response.write " <script fx.js""="" javascript""="" js="" src="" text="" type=""></script>" &amp; vbCrLf
response.write " <script cooltool.js""="" javascript""="" js="" src="" text="" type=""></script>" &amp; vbCrLf
response.write "" &amp; vbCrLf
response.write " </head>" &amp; vbCrLf
response.write "" &amp; vbCrLf
response.write " <body>" &amp; vbCrLf
response.write " <table #777777""="" 0""="" 95%""="" align="" bgcolor="" border="" cellpadding="" cellspacing="" center""="" width="">" &amp; vbCrLf
response.write " <tr>" &amp; vbCrLf
response.write " <td>" &amp; vbCrLf
response.write " <table 0""="" 1""="" 100%""="" 3""="" border="" cellpadding="" cellspacing="" width="">" &amp; vbCrLf
response.write " <tr align="" center""=""> " &amp; vbCrLf
response.write " <td #eeeeee""="" 100%""="" bgcolor="" width="">内部管理操作错误信息</td>" &amp; vbCrLf
response.write " </tr>" &amp; vbCrLf
response.write " <tr> " &amp; vbCrLf
response.write " <td #ffffff""="" 100%""="" bgcolor="" width=""><b>产生错误的可能原因:</b><br/><br/>" &amp; vbCrLf
response.write " <li>请您尽快与管理员联系,获得相应地的帮助。" &amp; vbCrLf
response.write sErrmsg &amp; vbCrLf
response.write " </li></td>" &amp; vbCrLf
response.write " </tr>" &amp; vbCrLf
response.write " <tr align="" center""=""> " &amp; vbCrLf
response.write " <td #eeeeee""="" 100%""="" bgcolor="" width="">" &amp; vbCrLf
response.write " <a href="" javascript:history.go(-1)""=""> &lt;&lt; 返回上一页</a>" &amp; vbCrLf
response.write " </td>" &amp; vbCrLf
response.write " </tr> " &amp; vbCrLf
response.write " </table> </td></tr></table>" &amp; vbCrLf
response.write " </body>" &amp; vbCrLf
response.write " </html>"
end sub

Published At
Categories with Web编程
Tagged with
comments powered by Disqus