Exemple #1
0
        public static void Main(string[] args)
        {
            Cliente cte = new Cliente(IPAddress.Parse("127.0.0.1"), 18000);

            cte.Conectar();
            Console.ReadKey();
        }
Exemple #2
0
        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}");
        }