Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Start button
- public void startserver_btn_Click(object sender, EventArgs e)
- {
- try
- {
- console_txt.AppendText(Environment.NewLine +"Started client based server....");
- Thread ServThread1 = CThread.Start(server3);
- stopsvr_btn.Visible = true;
- startserver_btn.Visible = false;
- console_txt.AppendText(Environment.NewLine + "Waiting for a connection... ");
- }
- catch (Exception)
- {
- console_txt.AppendText(Environment.NewLine + "ERROR");
- }
- }
- stop button
- public void stopsvr_btn_Click(object sender, EventArgs e)
- {
- try
- {
- console_txt.AppendText(Environment.NewLine + "Stoping client based server....");
- ServThread1.Abort();
- console_txt.AppendText(Environment.NewLine + "Stoped client based server....");
- stopsvr_btn.Visible = false;
- startserver_btn.Visible = true;
- }
- catch (Exception)
- {
- console_txt.AppendText(Environment.NewLine + "ERROR");
- }
- }
Add Comment
Please, Sign In to add comment