hi there,

i've got this code to download a CAB file from the internet, but it keeps
throwing me this error message:

"Value does not fall within the expected range"

code is below:
------------------------------------
Dim objRequest As System.Net.HttpWebRequest =
System.Net.WebRequest.Create(strCabURL)
Dim objResponse As System.Net.HttpWebResponse = objRequest.GetResponse()
Dim srResponse As New
System.IO.StreamReader(objResponse.GetResponseStream())
Dim sw As new IO.StreamWriter(IO.File.Create(AppPath & "\setup.cab"))

Try
sw.Write(srResponse.ReadToEnd())
MsgBox("Download Complete!")
Catch ex As Exception
MsgBox("error occured: " & ex.Message)
Finally
sw.Flush()
sw.Close()
sw = Nothing
End Try
srResponse.Close()
objResponse.Close()
srResponse = Nothing
objResponse = Nothing
objRequest = Nothing
sw = Nothing

------------------------------------

I cant understand why the error is occuring.
Any help appreciated!
thanks,
Paul