qq_36257233 2017-06-15 01:08 采纳率: 77.8%
浏览 828
已采纳

asp 执行出错啊。解码, showbo大神千呼万应你快来啊。

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")
%>
解码完毕,点击查看解码文件

  • 写回答

3条回答 默认 最新

  • Go 旅城通票 2017-06-15 01:18
    关注

    shit。。多了个括号,去掉
    if arr(i)<>"" and instr(arr(i)," | ")) then
    ==>
    if arr(i)<>"" and instr(arr(i)," | ")) then

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题