【发布时间】:2020-04-07 14:05:42
【问题描述】:
我在我的一个旧的 asp 经典页面中发现一行以 // 开头的 vbScript 代码,这是一个错误(用 // 而不是 ' 注释一行)。
无论如何,我注意到错误的注释行作为正确的注释行起作用。 有人知道为什么吗?? 非常感谢 莱昂纳多
我从那个旧代码中做了一个小例子:
<%
Response.Write "<u>testAsp.asp</u><hr/>"
V_Password="pwd"
//V_Password = Str2Hex(V_Password)
Response.Write "V_Password=" + V_Password + "<br/>"
Response.Write "V_Password(hex)=""" + Str2Hex(V_Password) + """"
function Str2Hex(s)
' -- converte stringa di byte (non caratteri ascii!!) in formato esadecimale
'
' The Asc function returns the ANSI character code corresponding
' to the first letter in a string.
' The AscB function is used with byte data contained in a string.
' Instead of returning the character code for the first character,
' AscB returns the first byte.
' AscW is provided for 32-bit platforms that use Unicode characters.
' It returns the Unicode (wide) character code, thereby avoiding
' the conversion from Unicode to ANSI.
dim k, out, MultiByte
out=""
for k=1 to len(s)
'response.Write("|" & hex(ascb(Mid(s,k,1))) & "|<br>" & vbCrLf)
out=out & hex(ascb(mid(s,k,1)))
next
Str2Hex="0x" & out
'response.write(out & vbCrLf)
end function
%>
这是生成的输出:
如您所见,asp 页面在 vbScript 中,并且还包含正确的 vbscript cmets...
【问题讨论】:
-
确定是 VBScript 而不是 JScript,两者都可以作为 Active Scripting 语言使用 Classic ASP 开箱即用?
-
如果你能提供一个关于你所看到的行为问题的最小例子会有所帮助。
-
是的,我确定。没有@language 指令。
标签: vbscript asp-classic