public ClientDriver(string username) { myUsername = username; client = new ClientObject(); client.Connect(); client.Send(myUsername); }
static void Main(string[] args) { Console.WriteLine("Введите ip адрес сервера"); serverip = IPAddress.Parse(Console.ReadLine()); Console.WriteLine("Введите порт сервера"); port = int.Parse(Console.ReadLine()); Console.Clear(); try { try { ClientObject Client = new ClientObject(); Client.Connect(serverip, port); Client.Start(); } catch (Exception ex) { Console.WriteLine(ex.Message); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private void btConnect_Click(object sender, EventArgs e) { client.Connect("127.0.0.1", 11000); }