public MainWindow()
 {
     InitializeComponent();
     try
     {
         helper.ConnectSocket();
     }
     catch
     {
         MessageBox.Show("server not work!");
         this.Close();
     }
     this.Closing += new CancelEventHandler(Helper.Window_Closing);
 }