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