private void btnConnect_Click(object sender, EventArgs e) { if (btnConnect.Text == "&Connect") { // Clear the log. tbData.Text = ""; // Create a tester instance. tester = new HeimdallCheck(); tester.SetAddress(tbAddress.Text, (ushort)numPort.Value); tester.SetLogin(tbUsername.Text, tbPassword.Text); // Before we connect, freeze the settings from further tampering. FreezeSettings(); // Change the Connect/Disconnect button. btnConnect.Text = "&Disconnect"; // Start the test and run the timer. UpdateStatus("Starting a heimdall test..."); tester.Start(); refreshTimer.Start(); } else { txtPhase.Text = "Aborted"; tester.Stop(); btnConnect.Text = "&Connect"; UpdateStatus("Test aborted!"); StopTest(); } }
/*** Helper Methods (PRIVATE) ***/ private HeimdallCheck RunHeimdallCheck(string username, string password) { HeimdallCheck hc = new HeimdallCheck(); hc.SetAddress(AppSettings.Address, AppSettings.Port); hc.SetLogin(username, password); hc.Start(); nRequestsMade++; return(hc); }