Click to See Complete Forum and Search --> : Connecting through URL


toytoy
March 7th, 2005, 11:43 PM
How to connect using url instead of IP address..

I try using the url instead of IP but the error given is

The data at the root level is invalid, Line 1 position 1...

I even try to delete the "http://" and put in "anything.com.sg" but still cannot works the error is still the same...


Try
tcpC.Connect("http://anything.com.sg", 12345)
Catch e As Exception
Console.WriteLine(e.ToString())
End Try


Thanks

DeepButi
March 8th, 2005, 03:23 AM
toytoy,
are you sure your url accepts connections to the specified port?

I use
tcpClient = New Net.Sockets.TcpClient()
Try
tcpClient.Connect("aaa.bbb.cc", 9112)
Catch m As Exception
MsgBox(m.ToString())
End Tryand it works fine.