Function UpRemoteFileToLocal(ByVal UpType As String, ByVal RemoteUrl As String, ByVal LocalFile As String) As Boolean
Dim TmpResult As Boolean = False
选择案例类型
案例“xmlhttp”
'使用 MSXML2
将 myXmlHttp 调暗为新的 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()
临时结果 = True
案例“网络客户端”
'使用 System.Net 命名空间
将 myWebClient 调暗为新的 WebClient
myWebClient.DownloadFile(RemoteUrl,LocalFile)
临时结果 = True
结束选择
结束功能