Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. Start button
  2. public void startserver_btn_Click(object sender, EventArgs e)
  3. {
  4. try
  5. {
  6. console_txt.AppendText(Environment.NewLine +"Started client based server....");
  7. Thread ServThread1 = CThread.Start(server3);
  8. stopsvr_btn.Visible = true;
  9. startserver_btn.Visible = false;
  10. console_txt.AppendText(Environment.NewLine + "Waiting for a connection... ");
  11. }
  12. catch (Exception)
  13. {
  14. console_txt.AppendText(Environment.NewLine + "ERROR");
  15. }
  16. }
  17.  
  18. stop button
  19. public void stopsvr_btn_Click(object sender, EventArgs e)
  20. {
  21. try
  22. {
  23. console_txt.AppendText(Environment.NewLine + "Stoping client based server....");
  24. ServThread1.Abort();
  25. console_txt.AppendText(Environment.NewLine + "Stoped client based server....");
  26. stopsvr_btn.Visible = false;
  27. startserver_btn.Visible = true;
  28. }
  29. catch (Exception)
  30. {
  31. console_txt.AppendText(Environment.NewLine + "ERROR");
  32. }
  33. }
Add Comment
Please, Sign In to add comment