Click here to Skip to main content
15,041,548 members
Please Sign up or sign in to vote.
2.67/5 (3 votes)
See more:
During development, we usually use localhost as the hostname, like the following
Dim serverListener As New TcpClient("localhost", 8585)

I want the user to be able to enter their IP address via a TextBox instead, like
Dim serverListener As New TcpClient(textbox1.text, 8585)

However, this is not working for me. Any ideas? Thanks!
Sergey Alexandrovich Kryukov 16-May-11 23:50pm
What's in textbox1.text, for example?
hamzah1 17-May-11 0:59am
it's a textbox that the user enter his IPs

1 solution

try this!!

Dim serverListener As New TcpClient()
Dim ip As IPAddress = IPAddress.Parse(textbox1.text)
serverListener.Connect(ip, 8585)
hamzah1 17-May-11 11:04am
It's didnt work !! i cant recive anything from the server

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900