Ejemplo n.º 1
0
//-------------------------------------------------------------------------------------
        private void button1_Click(object sender, RoutedEventArgs e)
        {   ///Tcp Host control,
            ///
            if (true == button1.IsEnabled)
            {
                addListBoxString(listBox1, "TCP host Up");
                button1.IsEnabled = false;
                button2.IsEnabled = false;
                button3.IsEnabled = true;
#if USETCPHOSTTHREAD
                TcpServer  = new TcpHostThread();
                newTcpHost = new Thread(new ThreadStart(TcpServer.TcpHostMethod));
                newTcpHost.Start();
                iRunType = 1;   ///0 for not run, 1 for server run, 2 for client run
#else
                newTcpHost = new Thread(new ThreadStart(this.TcpHostMethod));
                newTcpHost.Start();
#endif
            }
        }
Ejemplo n.º 2
0
//-------------------------------------------------------------------------------------
        private void button1_Click(object sender, RoutedEventArgs e)
        {   ///Tcp Host control,
            ///
            if (true == button1.IsEnabled)
            {
                addListBoxString(listBox1, "TCP host Up");
                button1.IsEnabled = false;
                button2.IsEnabled = false;
                button3.IsEnabled = true;
#if USETCPHOSTTHREAD
                TcpServer = new TcpHostThread();
                newTcpHost = new Thread(new ThreadStart(TcpServer.TcpHostMethod));
                newTcpHost.Start();
                iRunType = 1;   ///0 for not run, 1 for server run, 2 for client run
#else
                newTcpHost = new Thread(new ThreadStart(this.TcpHostMethod));
                newTcpHost.Start();
#endif
            }
        }