
Appendix 2
15(15)
{
// Program is stopped if an exception is present
server.Stop();
RunServer();
}
}
while(message != "QUIT1");
}
catch (Exception error)
{
// error code can be added here
}
}
// Function description--------------------------------------------- //
Initializes form.
public Form1()
{
InitializeComponent();
}
// Function description--------------------------------------------- //
Starts thread for communications.
private void Form1_Load(object sender, EventArgs e)
{
serverThread = new Thread(new ThreadStart(RunServer));
serverThread.Start();
CheckForIllegalCrossThreadCalls = false;
}
// Function description--------------------------------------------- //
List box option.
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
// Function description--------------------------------------------- //
Reset button action.
private void button2_Click(object sender, EventArgs e)
{
try
{
serverThread.Abort();
server.Stop();
Application.Restart();
}
catch (Exception error)
{
MessageBox.Show(error.ToString());
}
}
}
}
Comentarios a estos manuales