Question : Converting a url to a bytearray

"http://ccms.ochsner.org/tempfiles/PROO688192010105509AM13688694V001_001.GIF"

Assuming the above is a valid URL, and is all the information I have about the file, how do I use VB.NET to convert it to a ByteArray?

Standard file handling code returns "URI format is not supported".

Thanks in advance!

Answer : Converting a url to a bytearray

Do you want to convert the URL string into bytes OR get the bytes of the image that this URL is pointing towards?

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Dim wc As New System.Net.WebClient
Try
  Dim imageBytes() As Byte = wc.DownloadData("http://www.google.com/intl/en_ALL/images/srpr/logo1w.png")
  ' TODO:// work with byte data
Catch ex As Exception
  MsgBox(ex.Message)
Finally
  wc.Dispose()
  wc = Nothing
End Try
Random Solutions  
 
programming4us programming4us