se else:
if left(Bin2Str(bFlag),2)="BM" then
ADOS.Read(15)
ret(0)="bmp"
ret(1)=binval(ADOS.Read(4))
ret(2)=binval(ADOS.Read(4))
else
ret(0)=""
end if
end select
''
dim tempStr
dim nameStr
dim defaultName
dim ln
tempStr=split(GetStrUrl,"/")
nameStr=tempStr(ubound(tempStr))
if nameStr="" then
r_write "错误的URL,请输入可访问的URL",0
exit function
end if
fileName=split(nameStr,"?")(0)
ln=inStrRev(fileName,".")
if ln>0 then
preName=left(fileName,inStrRev(fileName,".")-1)
else
preName=fileName
end if
''R_write fileName,1
''R_write inStrRev(fileName,"."),1
''R_write fileName,0
extName=right(fileName,len(fileName)-inStrRev(fileName,"."))
Select case ret(0)
case "png","jpg","bmp","gif","swf"
width=ret(1)
height=ret(2)
imgSize=fsize
imgType=ret(0)
imgName=preName&"."&ret(0)
case else
width=0
height=0
imgSize=fsize
imgName="unknow"
imgType=".unknow"
end select
if SaveMode="1" then
defaultName=imgName
if SaveName="" then
SaveName=defaultName
else
if lcase(right(SaveName,4))<>"."&imgType then
SaveName=SaveName&"."&imgType
end if
end if
else
defaultName=filename
end if
if SaveName="" then SaveName=defaultName
SavePath=replace(SavePath,"//","/")
if right(SavePath,1)<>"/" then SavePath=SavePath&"/"
if SavePath="" then SavePath="./"
DiskPath=server.mappath(SavePath&SaveName)
XuPath=replace(replace(DiskPath,server.mappath("/"),""),"\","/")
NewUrl="http://"&Request.ServerVariables("SERVER_NAME")&XuPath
getimagesize=ret
End Function
Public function SaveImg(FullPath)
SaveImg=false
if SaveMode="1" then
if trim(fullpath)="" or _
width=0 or _
height=0 or _
imgSize=0 or _
imgType=".unknow" then exit function end if
end if
ADOS.Position=0
if SaveMode="2" then
ADOS.Type=2
ADOS.Charset ="gb2312"
ADOS.SaveToFile FullPath,2
textStr=ADOS.readtext()
else
ADOS.SaveToFile FullPath,2
end if
SaveImg=true
End function
P