Microsoft VBScript 编译器错误 错误 '800a03f9'
缺少 'Then'
/s/s.asp,行 57
if arr(i)<>"" and instr(arr(i)," | "))<>0 then'?в? |
------------------------------------^
这是什么问题
<%@LANGUAGE="VBScript" CODEPAGE="65001"%>
<%
Function EnCodeY(sText,sCode)'当参数传入
Dim arrCode(),i,flag,strResult
arrData = split(sText, "-")
cntData = UBOUND(arrData) - 1
cntCode = Len(sCode) - 1
Redim arrCode(cntCode)
For i = 0 To cntCode
arrCode(i) = Mid(sCode, i + 1, 1)
Next
flag = 0
strResult = ""
For i = 0 To cntData
strResult = strResult & CHR(Cint(arrData(i)) XOR ASC(arrCode(flag)))
IF flag = cntCode Then
flag = 0
Else
flag = flag + 1
End IF
Next
EnCodeY = strResult
End Function
function readText(path,charset)'读文件
set ts=server.CreateObject("adodb.stream")
ts.charset=charset'内容编码
ts.mode=3'读写模式
ts.type=2'文本模式
ts.open
ts.LoadFromFile path
readText=ts.readtext
ts.close:set ts=nothing
end function
function writeText(path,charset,text)'写文件
set ts=server.CreateObject("adodb.stream")
ts.mode=3'写写模式
ts.type=2'文本模式
ts.open
ts.charset=charset'内容编码
ts.WriteText text,1
ts.SaveToFile path,2
ts.close:set ts=nothing
end function
function findCode(v,arr)'查找开头数字一样的code值
dim i,l,arrCode
l=ubound(arr)
for i=0 to l
if arr(i)<>"" and instr(arr(i)," | "))<>0 then'非空行并且包含 |
arrCode=split(arr(i)," | ")
if arrCode(0)=v then
findCode=arrCode(1)
exit function
end if
end if
next
end function
function doDecode(path1,pathcode,pathrst)'path1:要解码的文件物理路径 pathcode:code文件物理路径 pathrst:解
码保存文件物理路径
dim arrA,arrCode,l,i,s,scode,arr
arrA=split(replace(readText(path1,"gb2312"),chr(13),""),chr(10))
arrCode=split(replace(readText(pathcode,"gb2312"),chr(13),""),chr(10))
s=""
l=ubound(arrA)
for i=0 to l
if trim(arrA(i))<>"" and instr(arrA(i)," | "))<>0 then'非空行并且包含 |
arr=split(arrA(i)," | ")
scode=findCode(arr(0),arrCode)
if scode="" then
response.Write arr(0)&"找不到code代码<br>"
else
if s<>"" then s=s&chr(13)&chr(10)
s=s&arr(0)&" | "&EnCodeY(arr(1),scode)'如果不需要前缀id,去掉arr(0)&" | "&
end if
else
response.Write arrA(i)&"为空或者没有分隔符号“ | ”<br>"
end if
next
writeText pathrst,"gb2312",s
end function
doDecode server.MapPath("1.txt"),server.MapPath("2.txt"),server.MapPath("3.txt")
%>
解码完毕,点击查看解码文件