I found some solutions to read text web document using StreamReader and ReadToEnd, but the solutions does not work with binary data (pdf and doc documents, gif and jpeg images). Next function reads binary document from URL using HttpWebRequest and returns the document as byte()
for 'HttpWebRequest and binary document, VB.Net code' article
Copyright and use this code
The source code on this page and other samples at http://www.motobit.com/tips/ are a free code, you can use it as you want: copy it, modify it, use it in your products, ...
If you use this code, please:
1. Leave the author note in the source.
2. Link this sample from you page.
<A Href="http://www.motobit.com/tips/detpg_vbnet-binary-get-url/" Title="Short function to read binary data (pdf, gif) from URL using HttpWebRequest, ResponseStream and temporary binary memory stream." >HttpWebRequest and binary document, VB.Net code</A>
© 1996 - 2014 Antonin Foller, Motobit Software | About, Contacts | (Find us on Google+)