"Al Reid" <ar*****@reidDASHhome.com> schrieb:
In VB6 I would use the Inet Control to retrieve the contents of a web page
to a string. What is the .NET way of doing this?
\\\
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://classicvb.org/petition/>