Esempio n. 1
0
 public FormMain()
 {
     myServer              = MyServer.GetInstance();
     myServer.ClientAdd    = new MyServer.ClientChangeHandler(myServer_ClientAdd);
     myServer.ClientRemove = new MyServer.ClientChangeHandler(myServer_ClientRemove);
     InitializeComponent();
     //关闭对文本框的非法线程操作检查
     TextBox.CheckForIllegalCrossThreadCalls      = false;
     DataGridView.CheckForIllegalCrossThreadCalls = false;
 }
Esempio n. 2
0
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            myServer = MyServer.GetInstance();
            //myServer.ReceivedMsg = new MyServer.ReceivedMsgHandler(socketClient_ReceivedMsg);

            //Application.Run(new FormMain());


            FormMain main = null;

            new Thread((ThreadStart) delegate
            {
                main = new FormMain();
                Application.Run(main);
            }).Start();

            myServer.BeginServer();
            Console.ReadLine();
        }