Retrieve Data from web server
-
I have the code as below: Dim req As HttpWebRequest = HttpWebRequest.Create("myURL") req.Method = "GET" Dim res As HttpWebResponse = req.GetResponse() Dim stream As System.IO.Stream = res.GetResponseStream() Dim buff(100000) As Byte stream.Read(buff, 0, 100000) System.IO.File.WriteAllBytes("C:\Documents and Settings\Yunosuki\Desktop\abc.bmp", buff) That code will send request to web server and get the response! With text format, every things are ok! With the image format, I can see the image of "abc.bmp" file. Thanks for any help! Hung
-
I have the code as below: Dim req As HttpWebRequest = HttpWebRequest.Create("myURL") req.Method = "GET" Dim res As HttpWebResponse = req.GetResponse() Dim stream As System.IO.Stream = res.GetResponseStream() Dim buff(100000) As Byte stream.Read(buff, 0, 100000) System.IO.File.WriteAllBytes("C:\Documents and Settings\Yunosuki\Desktop\abc.bmp", buff) That code will send request to web server and get the response! With text format, every things are ok! With the image format, I can see the image of "abc.bmp" file. Thanks for any help! Hung
Hi, I didn't understand. Are you asking a question or just stating something? :) I'm online at www.KYNOU.com if you need help