static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //这里新启一个线程
            Thread thread = new Thread(new ParameterizedThreadStart(mainThreadStart));
            thread.IsBackground = true;
            thread.Start();
            //这里为主线程,运行窗体
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }        
        private static void mainThreadStart(object obj)
        {
            Client.SocketRelated.MainSend ms = new Client.SocketRelated.MainSend();
            ms.BeginSend("127.0.0.1", 5656, "测试数据");
        }
    }