private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         if (client != null)
         {
             client.SendQuitMessage();
         }
     }
     catch { }
 }