VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,398 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,621 people online right now. Registration is fast and FREE... Join Now!




web stream reader?

 

web stream reader?

Asscotte

2 Jul, 2009 - 08:10 AM
Post #1

D.I.C Regular
Group Icon

Joined: 8 Feb, 2009
Posts: 398



Thanked: 10 times
Dream Kudos: 175
My Contributions
Is there a method of using the stream reader to read webfiles? if so what is it and do you have any tutorials.

[Code:none thats why I posted]

thanks,

User is offlineProfile CardPM
+Quote Post


Amrykid

RE: Web Stream Reader?

2 Jul, 2009 - 04:56 PM
Post #2

D.I.C Addict
Group Icon

Joined: 16 Dec, 2008
Posts: 899



Thanked: 10 times
Dream Kudos: 350
My Contributions
QUOTE(Asscotte @ 2 Jul, 2009 - 09:10 AM) *

Is there a method of using the stream reader to read webfiles? if so what is it and do you have any tutorials.

[Code:none thats why I posted]

thanks,

yes, there is.
CODE

Public Function ReadFile(ByVal url As String) As String
        Dim req As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
        Dim rep As System.Net.HttpWebResponse = req.GetResponse()
        Dim str As New System.IO.StreamReader(rep.GetResponseStream)
        return str.ReadToEnd()
    End Function

Modify that code to your needs

This post has been edited by Amrykid: 2 Jul, 2009 - 04:59 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 10:10PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month