Ejemplo n.º 1
0
 private void GetDataAndUpdateConsolOutputBox()
 {
     while (running)
     {
         SocketServerEx.GetReceivedDataEvent().WaitOne();
         string str = SocketServerEx.GetData();
         Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
                                               new ThreadStart(delegate
         {
             tbConsoleOutPut.Text = DateTime.Now.ToString("h:mm:ss tt") +
                                    " Client: " + str + tbConsoleOutPut.Text;
         }));
     }
 }
Ejemplo n.º 2
0
 private void GetDataAndUpdateConsoleOutputBox()
 {
     while (running)
     {
         SocketServerEx.GetReceivedDataEvent().WaitOne();
         //SocketServerEx.GetAutoResetEvent().WaitOne();
         var str  = SocketServerEx.GetData();
         var size = str.Length;
         Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
                                               new ThreadStart(
                                                   delegate
         {
             tbConsoleOutput.Text = tbConsoleOutput.Text + DateTime.Now.ToString("h:mm:ss tt") + " Client:\n" + str;
             tbConsoleOutput.ScrollToEnd();
         }));
     }
 }