rivate Function Bin2Str(Bin)
Dim I,Str,clow
For I=1 to LenB(Bin)
clow=MidB(Bin,I,1)
if ASCB(clow)<128 then
Str = Str & Chr(ASCB(clow))
else
I=I+1
if I <= LenB(Bin) then Str = Str & Chr(ASCW(MidB(Bin,I,1)&clow))
end if
Next
Bin2Str = Str
End Function
Private Function Num2Str(num,base,lens)
dim ret:ret = ""
while(num>=base)
ret=(num mod base) & ret
num=(num - num mod base)/base
wend
Num2Str = right(string(lens,"0") & num & ret,lens)
End Function
Private Function Str2Num(str,base)
dim ret:ret = 0
for i=1 to len(str)
ret = ret *base + cint(mid(str,i,1))
next
Str2Num=ret
End Function
Private Function BinVal(bin)
dim ret:ret = 0
for i = lenb(bin) to 1 step -1
ret = ret *256 + ascb(midb(bin,i,1))
next
BinVal=ret
End Function
Private Function BinVal2(bin)
dim ret:ret = 0
for i = 1 to lenb(bin)
ret = ret *256 + ascb(midb(bin,i,1))
next
BinVal2=ret
End Function
Private Function GetWebData(byval StrUrl)
if StrUrl="" then
r_write "无效",1
exit function
end if
dim tempStr
tempStr=split(GetStrUrl,"/")
if tempStr(ubound(tempStr))="" or inStr(StrUrl,"/")=0 then
R_Write "未指定有效的URL",0
exit function
end if
dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", StrUrl, False, "", ""
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
End Function
End Class
%>
<%
SUB saveUpload(GetUrl,SavePath,SaveName,mode)
dim chkInfo
if GetUrl="" then
call tform()
R_Write "<br>传输文件栏没有填写!",0
end if
set imgUp=new BoxInfoImg
if mode="1" and imgUp.imgName="unknow" then
call tform()
set imgUp=nothing
R_Write "<br>传输文件栏没有填写有效的图像URL!",0
end if
chkInfo=""
dim i,testStr,showStr
''限定格式
select case imgUp.imgType
case "png","jpg","bmp","gif"
if imgUp.width=0 or imgUp.height=0 or imgUp.imgSize=0 then
chkInfo="<li>"+"传输图像数据不存在,请确定你的URL是否正确"
end if
case else
chkInfo="<li>无效的传输格式,允许图像数据格式为 ""png"",""jpg"",""bmp"",""gif""</li>"
end select
''R_Write SavePath,1
''R_Write mode,1
''R_Write imgUp.imgName,1
''R_Write imgUp.filename,1
''R_Write "SaveName="&SaveName,1
if mode="1" and chkInfo<>"" then ''检查上传图像数据合格后,则保存之
call tform()
R_Write chkInfo,0
else
Server.ScriptTimeOut=5000
imgUp.saveImg imgUp.D