<%
dimact、iflogin、loginurl、loginacturl、logindata、fileurl、filename
act = request.querystring( "act")
if(act = "do")then
iflogin = cint(request.querystring( "iflogin"))
loginacturl = request.form( "loginacturl")
logindata = request.form( "logindata")
fileurl = request.form( "fileurl")
filename = mid(fileurl、instrrev(fileurl、 "/")+1)
extpos = instrrev(filename、 "?")
if(extpos> 0)then
filename = left(filename、extpos-1)
endif
if(iflogin = 1)then
callposthttppage(loginacturl、logindata)
endif
calldownloadfile(fileurl、filename)
それ以外
%>
<formName = "form1" method = "post" action = "?act = do">
<p>是否登录:
<inputname = "iflogin" type = "Radio" value = "1">
是
<inputname = "iflogin" type = "radio" value = "0" checked>
否</p>
<p>登录提交地址:
<inputname = "loginacturl" type = "text" size = "50">
</p>
<p>
登录数据:<inputname = "logindata" type = "text" size = "50">
</p>
<p>
要保存的远程文件URL:
<inputname = "fileurl" type = "text" size = "50">
</p>
<p>
<inputType = "submit" name = "" submit "value ="提交 ">
<inputType = "reset" name = "submit2" value = "重写">
</p>
</form>
<%
endif
functionbytestobstr(body、code)
DimobjStream
setobjstream = server.createObject( "adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.open
objstream.writebody
objstream.position = 0
objstream.type = 2
objstream.charset = code
bytestobstr = objstream.readtext
objstream.close
setobjstream =何もない