最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASPX保存远程图片到本地的两种方法的函数
时间:2022-06-30 11:29:32 编辑:袖梨 来源:一聚教程网
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.responseBody)
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
相关文章
- 炉石传说血DK卡组怎么样 炉石传说血DK卡组推荐介绍 11-05
- 咒术回战幻影夜行官网在哪里 咒术回战幻影夜行官网地址介绍 11-05
- 蚂蚁庄园今天答题答案2024年10月26日 11-05
- 以闪亮之名变装物语甜趣篇怎么玩 11-05
- 闪耀暖暖永夜禁锢怎么玩 11-05
- 闪耀暖暖永夜禁锢怎么玩 闪耀暖暖永夜禁锢活动介绍 11-05