aspx保存远程图片到本地的两种方法的函数
function upremotefiletolocal(byval uptype as string, byval remoteurl as string, byval localfile as string) as boolean
dim tmpresult as boolean = false
select case uptype
case "xmlhttp"
'with msxml2
dim myxmlhttp as new msxml2.xmlhttp40
myxmlhttp.open("get", remoteurl, false)
myxmlhttp.send()
dim fs as filestream = new filestream(localfile, filemode.createnew)
dim bw as binarywriter = new binarywriter(fs)
bw.write(myxmlhttp.resp
bw.close()
fs.close()
tmpresult = true
case "webclient"
'with system.net namespace
dim mywebclient as new webclient
mywebclient.downloadfile(remoteurl, localfile)
tmpresult = true
end select
end function