ASP vbs 代码大小写规范
2024-05-04 11:09:24
供稿:网友
asp大小写规范是个网页转换工具,实现asp中大小写的替换,大家可以测试下
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; Charset=gb2312" />
<title>ASP vbs 代码大小写规范-武林网</title>
</head>
<body>
<p align="center">
<textarea Name="aspvbs" cols="100" rows="10" ></textarea>
</p>
<p align="center">
<input Type="button" Name="Submit2" Value="∧贴到上边" style="color:#FF0000" onclick="document.getElementById('aspvbs').value=window.clipboardData.getData('text')" />
<input Type="submit" Name="Submit" Value="转换" onclick="aspvbs()" />
<script language=javascript>
function aspvbs()
{
var ss=document.getElementById("aspvbs").value;
var vbs0="函数关键字|Function|Sub|";
var vbs1="保留关键字|And|As|ByRef|Call|Case|Class|Const|Dim|Do|Each|Else|ElseIf|Empty|End|Eqv|Erase|Execute|ExecuteGlobal|Exit|Explicit|False|For|Get|Goto|If|Imp|In|Is|Let|Loop|Mod|Next|Not|Nothing|Null|On|Option|Or|Private|Public|Randomize|ReDim|Rem|Resume|Select|Set|Stop|Then|To|True|Until|Wend|While|With|Xor|";
var vbs2="本机关键字|Abandon|Abs|AbsolutePage|AbsolutePosition|ActiveConnection|ActualSize|AddHeader|AddNew|AppendChunk|AppendToLog|Application|Application_OnEnd|Application_OnStart|Array|Asc|Atn|Attributes|BeginTrans|BinaryRead|BinaryWrite|BOF|Bookmark|Boolean|Buffer|CacheControl|CacheSize|Cancel|CancelBatch|CancelUpdate|CBool|CByte|CCur|CDate|CDbl|Charset|Chr|CInt|Clear|ClientCertificate|CLng|Clone|Close|CodePage|Command|CommandText|CommandTimeout|CommandType|CompareBookmarks|Connection|ConnectionString|ConnectionTimeout|Contents|ContentType|Cookies|Cos|Count|CreateParameter|CreateObject|CSng|CStr|CursorLocation|CursorType|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|DefaultDatabase|DefinedSize|Delete|Description|Dictionary|Direction|EditMode|EOF|Err|Error|Errors|Eval|Execute|Exp|Expires|ExpiresAbsolute|Field|Fields|File|FileSystem|Filter|Find|Fix|Flush|Form|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetChunk|GetLocale|GetObject|GetRef|GetRows|GetString|HelpContext|HelpFile|Hex|Hour|HTMLEncode|Index|InputBox|InStr|InStrRev|Int|Integer|IsArray|IsClientConnected|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|IsolationLevel|Item|Join|LBound|LCase|LCID|Left|Len|LoadPicture|Lock|LockType|Log|LTrim|MapPath|MarshalOptions|Match|Mid|Minute|Mode|Month|MonthName|Move|MoveFirst|MoveLast|MoveNext|MovePrevious|MsgBox|Name|NativeError|NextRecordset|Now|Number|NumericScale|NumericScale|ObjectContext|Oct|OnTransactionAbort|OnTransactionCommit|Open|OpenSchema|OriginalValue|PageCount|PageSize|Parameter|Parameters|Pics|Precision|Prepared|Properties|Property|PropertyGet|PropertyLet|PropertySet|Provider|QueryString|Raise|RecordCount|Recordset|Redirect|RegExp|Replace|Requery|Request|Response|Resync|RGB|Right|Rnd|RollbackTrans|Round|RTrim|Save|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|ScriptTimeout|Second|Seek|Server|ServerVariables|Session|Session_OnEnd|Session_OnStart|SessionID|SetAbort|SetAllRowStatus|SetComplete|SetLocale|Sgn|Sin|Size|Sort|Source|Space|Split|SQLState|Sqr|State|StaticObjects|Status|StrComp|String|StrReverse|Supports|Tan|Test|Time|Timeout|Timer|TimeSerial|TimeValue|TotalBytes|Trim|Type|TypeName|UBound|UCase|UnderlyingValue|Unlock|Update|UpdateBatch|URLEncode|URLPathEncode|Value|VarType|Version|Weekday|WeekdayName|Write|Year|";
var vbs3="常量|vbArray|vbBinaryCompare|vbBlack|vbBoolean|vbBlue|vbByte|vbCr|vbCrLf|vbCurrency|vbCyan|vbDataObject|vbDate|vbDecimal|vbEmpty|vbError|vbFalse|vbFirstJan1|vbFirstFourDays|vbFirstFullWeek|vbFormFeed|vbFriday|vbGeneralDate|vbGreen|vbInteger|vbLf|vbLong|vbLongDate|vbLongTime|vbMagenta|vbMonday|vbNewLine|vbNull|vbNullChar|vbNullString|vbObject|vbObjectError|vbRed|vbSaturday|vbShortDate|vbShortTime|vbSingle|vbString|vbSunday|vbTab|vbTextCompare|vbThursday|vbTrue|vbTuesday|vbUseDefault|vbUseSystem|vbUseSystemDayOfWeek|vbVariant|vbVerticalTab|vbWednesday|vbWhite|vbYellow|";
//原则上s应该是"|str1|str2|"
s=vbs0+vbs1+vbs2+vbs3;
function re_aspvbs(a, b)
{
var re = new RegExp("//|("+ b +")//|", "ig");
if(re.test(s)) return RegExp.$1;
else return b;
}
var re = //b(/w+)/b/g;
ss = ss.replace(re, re_aspvbs);
document.getElementById("show").value=ss;
}
</script>
<input Type="button" Name="Submit3" Value="复制下边的∨" style="color: #FF00FF" onclick="window.clipboardData.setData('text',document.getElementById('show').value)" />
</p>
<p align="center">
<textarea Name="show" cols="100" rows="10" ></textarea>
</p>
</body>
</html>