Exemplo n.º 1
0
        public Program()
        {
            TWindow = new Thread(new ThreadStart(CreateWindow));
            TWindow.Start();
            Thread.Sleep(1000);
            Window.WindowClose += OnClientWindowClose;

            NetClient = new NetClient();
            NetClient.OnLogEvent += OnClientLog;
            NetClient.OnNetworkDataAvailabe += OnServerSendLine;
            string input = Microsoft.VisualBasic.Interaction.InputBox("Please enter the IP address or URL of the server you want to connect to.", "Enter Server IP", "");
            NetClient.Connect(input, 9001);
            Window.SendLine += OnClientSendLine;
        }
Exemplo n.º 2
0
        public Program()
        {
            Client = new NetClient();
            Client.OnNetworkDataAvailabe += ProcessNetworkEvent;
            Client.OnLogEvent += ProcessLogEvent;

            InputListener = new Thread(new ThreadStart(HandleInput));
            Console.WriteLine("Please enter the IP address or URL of the server you want to connect to.");
            string host = Console.ReadLine();
            Console.WriteLine("Please enter the port number of the server you want to connect to.");
            int port = int.Parse(Console.ReadLine());
            Client.Connect(host, port);
            InputListener.Start();
        }