Take a look at the System.Net namespace and associated classes. I'm not
sure about the new stuff in .Net 2.0+, but I do believe it has some new
stuff not available in 1.1. Since our shop is still in the stone age...err,
..Net 1.1 age, we have just had to manage using the normal HttpRequest and
HttpResponse.
Not sure if this is really the alternative to the inet control, but
maybe you should take a look at the System.Net.Socket.TcpClient class
and its friends.
Here is some code from one of my routines that takes the URL in a text box
(e.g. http://www.IMB.com) and returns the underlying HTML for the URL as the
string S below.
Dim URL As String = Trim(Me.txtURL.Text)
Dim wreq As System.Net.HttpWebRequest
wreq = CType(System.Net.WebRequest.Create(URL),
System.Net.HttpWebRequest)
Dim response As System.Net.HttpWebResponse = wreq.GetResponse
Dim encode As System.Text.Encoding =
System.Text.Encoding.GetEncoding("utf-8")
Dim readStream As New
System.IO.StreamReader(response.GetResponseStream, encode)
Dim S As String = readStream.ReadToEnd
readStream.Close()
readStream = Nothing
response.Close()
response = Nothing
Me.txtPage.Text = S
wreq = Nothing
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.