Visual Basic [VB] >> Open URL and read page
> In vb 6 there was a control you could use to open a url, set the time
> out and read the resulting page.
> how is this done in VB.Net?
\\\
Imports System.IO
Imports System.Net
.
.
.
Public Function LoadTextFile(ByVal Url As String) As String
Dim wrq As WebRequest = WebRequest.Create(Url)
Dim wrp As HttpWebResponse = _
DirectCast(wrq.GetResponse(), HttpWebResponse)
Dim sr As New StreamReader(wrp.GetResponseStream)
Dim Text As String = sr.ReadToEnd()
sr.Close()
wrp.Close()
Return Text
End Function
///
Visual Basic [VB] >> Open URL and read page
Great Thanks
>> In vb 6 there was a control you could use to open a url, set the time
>> out and read the resulting page.
>> how is this done in VB.Net?
>
> \\\
> Imports System.IO
> Imports System.Net
> .
> .
> .
> Public Function LoadTextFile(ByVal Url As String) As String
> Dim wrq As WebRequest = WebRequest.Create(Url)
> Dim wrp As HttpWebResponse = _
> DirectCast(wrq.GetResponse(), HttpWebResponse)
> Dim sr As New StreamReader(wrp.GetResponseStream)
> Dim Text As String = sr.ReadToEnd()
> sr.Close()
> wrp.Close()
> Return Text
> End Function
> ///
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
>