ASPX保存远程图片到本地的两种方法的函数
2006-08-14 16:39
543 查看
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
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
相关文章推荐
- ASPX保存远程图片到本地的两种方法的函数
- ASPX保存远程图片到本地的两种方法的函数
- ASP.NET下载远程图片保存到本地的方法、保存抓取远程图片
- php 远程图片保存到本地的函数类
- 下载远程(第三方服务器)文件、图片,保存到本地(服务器)的方法、保存抓取远程文件、图片
- 用ASP.NET实现下载远程图片保存到本地的方法 保存抓取远程图片的方法
- php获取远程图片并下载保存到本地的方法分析
- PHP下载远程图片并保存到本地方法总结
- PHP获取远程图片并保存到本地的方法
- 分享PHP源码批量抓取远程网页图片并保存到本地的实现方法
- jsp获取远程图片保存到本地服务器上方法
- PHP下载远程图片并保存到本地方法
- PHP获取远程图片并保存到本地的方法
- 分享PHP源码批量抓取远程网页图片并保存到本地的实现方法
- ASP.NET下载远程图片保存到本地的方法、保存抓取远程图片
- php下保存远程图片到本地的函数
- DEDE不能远程保存(下载)图片到本地的解决方法
- ASP.NET下载远程图片保存到本地的方法、保存抓取远程图片
- Dedecms无法保存远程图片到本地服务器的解决方法
- PHP下载远程图片并保存到本地方法总结