Connecting to Internet from code

  • Thread starter Thread starter JustMe
  • Start date Start date
J

JustMe

Sorry - probably a stupid question, but I don't know the answer!

I have a windows service which needs to connect to (and also
disconnect from) the internet automatically without user intervention
from vb.net.

Can anyone help?
 
Hi Adrew

Something as this

\\\
Dim myReg As Net.HttpWebRequest = _
DirectCast(Net.WebRequest.Create("http://wathever/mypage.html"), _
Net.HttpWebRequest)
Dim myResp As Net.HttpWebResponse = _
DirectCast(myReg.GetResponse(), Net.HttpWebResponse)
Dim myStream As IO.Stream = myResp.GetResponseStream()
Dim myreader As New IO.StreamReader(myStream)
Dim mystring As String = myreader.ReadToEnd()
myResp.Close()
///

I hope this helps?

Cor
 
Back
Top