예제 #1
0
        static void Main(string[] args)
        {
            int[,] map = new int[9, 9] {
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
            };


            map = new int[9, 9] {
                { 5, 3, 0, 0, 7, 0, 0, 0, 0 },
                { 6, 0, 0, 1, 9, 5, 0, 0, 0 },
                { 0, 9, 8, 0, 0, 0, 0, 6, 0 },
                { 8, 0, 0, 0, 6, 0, 0, 0, 3 },
                { 4, 0, 0, 8, 0, 3, 0, 0, 1 },
                { 7, 0, 0, 0, 2, 0, 0, 0, 6 },
                { 0, 6, 0, 0, 0, 0, 2, 8, 0 },
                { 0, 0, 0, 4, 1, 9, 0, 0, 5 },
                { 0, 0, 0, 0, 8, 0, 0, 7, 9 }
            };
            EditTable(map);

            Console.WriteLine("Sending");
            ClientClass clint = new ClientClass();

            clint.Post(map);
            Console.WriteLine("Send");
            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            //Connect("127.0.0.1", "String message");
            ClientClass clientClass = new ClientClass("127.0.0.1", 13000);

            clientClass.Connect();
            clientClass.SendMessage("Hello there!");
            //clientClass.SendMessage("Auth: Me");
        }
예제 #3
0
        static void Main(string[] args)
        {
            ClientClass client = new ClientClass(PORT);

            client.Start();


            Console.ReadLine();
        }
예제 #4
0
        static void Main(string[] args)
        {
            //Connect("127.0.0.1", "String message");
            ClientClass client = new ClientClass("127.0.0.1", 13000);

            client.OnMessageReceived += (message) => { Console.WriteLine("Message received: " + message); };

            client.Connect();

            client.Disconnect();
            client.SendMessage("Hello world");
        }
예제 #5
0
        static void Main(string[] args)
        {
            //Connect("127.0.0.1", "String message");

            ClientClass client = new ClientClass("127.0.0.1", 13000);

            client.Connect(new TcpClient());
            client.OnMessageRecevd += (message) => {};
            client.SendMessage("Hello world!");
            Console.ReadLine();
            client.Disconnect();
            Console.ReadLine();
        }
예제 #6
0
        static void Main(string[] args)
        {
            //Connect("127.0.0.1", "String message");
            ClientClass client = new ClientClass("127.0.0.1", 13000);

            client.OnMessageRecieved += (message) =>
            {
                Console.WriteLine($"Message received: {message}");
            };
            client.Connect();
            client.SendMessages("Message to server");
            Console.ReadLine();
            client.Disconnect();
        }
        static void Main(string[] args)
        {
            ClientClass client = new ClientClass();

            client.Geantwortet += Client_Geantwortet;
            client.Connect("localhost", 15321);

            Thread t = new Thread(new ThreadStart(() =>
            {
                Thread.Sleep(1000);
                while (client.IsConnected)
                {
                    client.Write(TCP_Protocoll.HeaderData.Broadcast, "Hello From " + (new Random()).Next(0, 100).ToString());
                    Thread.Sleep(1000);
                }
            }));

            t.Start();

            Console.ReadKey();
        }
예제 #8
0
        /// <summary>
        /// В main объявляется экземляр класса в котором описана работа клиента , а потом вызывается и сам метод класса экземпляр которого мы создали.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ClientClass InstanceClintClass = new ClientClass();

            InstanceClintClass.Client();
        }