S
Stacey Levine
Ok.. Maybe I am trying the wrong approach. If given a URL to a graphic, I
want to save that graphic to a local file. The approach below gets the
response, but I can't quite figure out how to save it to a file. In this
instance, a file gets created but it only contains the text
"System.Io.StreamReader" I have also tried writer.write(reader.ReadToEnd),
but the file still displays nothing.
Dim URL As String = GraphicURL
Dim request As WebRequest = WebRequest.Create(URL)
Dim response As WebResponse = request.GetResponse()
Dim reader As StreamReader = New
StreamReader(response.GetResponseStream())
Dim writer As StreamWriter = New StreamWriter("C:\temp\" & GraphicKey &
".jpg")
writer.Write(reader)
writer.Close()
reader.Close()
response.Close()
Stacey Levine
want to save that graphic to a local file. The approach below gets the
response, but I can't quite figure out how to save it to a file. In this
instance, a file gets created but it only contains the text
"System.Io.StreamReader" I have also tried writer.write(reader.ReadToEnd),
but the file still displays nothing.
Dim URL As String = GraphicURL
Dim request As WebRequest = WebRequest.Create(URL)
Dim response As WebResponse = request.GetResponse()
Dim reader As StreamReader = New
StreamReader(response.GetResponseStream())
Dim writer As StreamWriter = New StreamWriter("C:\temp\" & GraphicKey &
".jpg")
writer.Write(reader)
writer.Close()
reader.Close()
response.Close()
Stacey Levine