Here is the function I developed:
Public Function DownLoadWebFile(ByVal iSiteAddr As String, ByVal iFileName As String) As Boolean
DownLoadWebFile = False
If IsPath(FilePathOnly(iFileName)) = False Then
Exit Function
End If
DeleteFile(iFileName)
Try
Dim iRequest As System.Net.HttpWebRequest
Dim targetURI As New Uri(iSiteAddr)
iRequest = DirectCast(System.Net.HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest)
If (iRequest.GetResponse().ContentLength > 0) Then
Dim str As New System.IO.StreamReader(iRequest.GetResponse().GetResponseStream())
File.WriteAllText(iFileName, str.ReadToEnd)
str.Close()
DownLoadWebFile = True
End If
Catch ex As System.Net.WebException
MsgBox("ERROR! IOException " & vbCrLf & ex.ToString, , )
End Try
End Function