Answer the question
In order to leave comments, you need to log in
How to convert "System.String" to type "System.Net.IPAddress"?
Could not cast object type 'System.String' to type 'System.Net.IPAddress'.
Dim ServerIP = "127.0.0.1"
Dim ServerPort As Integer = 50000
TextBoxServerIP.Text = ServerIP
TextBoxServerPort.Text = ServerPort
Dim Server As New TcpListener(ServerIP, ServerPort)
Server.Start()
Where is the error?
Answer the question
In order to leave comments, you need to log in
As I understand it, you need to dance towards Parse
Dim ServerIP = "127.0.0.1"
Dim address As IPAddress = IPAddress.Parse(ServerIP)
Dim ServerPort As Integer = 50000
TextBoxServerIP.Text = ServerIP
TextBoxServerPort.Text = ServerPort
Dim Server As New TcpListener(address, ServerPort)
Server.Start()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question