public static void Main(string[] args) { Cliente cte = new Cliente(IPAddress.Parse("127.0.0.1"), 18000); cte.Conectar(); Console.ReadKey(); }
private void BtnConectar_Click(object sender, EventArgs e) { int puerto; bool validation = int.TryParse(txtPuerto.Text, out puerto); if (!validation) { MessageBox.Show("port invalido"); } string ip = txtIP.Text; cliente.Conectar(ip, puerto); Log($"IP = {cliente.RemoteEndPoint.Address}, PORT = {cliente.RemoteEndPoint.Port}"); }