public void GetLicenseKeyTest() { string key = "11111-11111-11111-11111-11111"; ClientWork clientWork = new ClientWork(); string resKey = clientWork.GetLicenseKey(); Assert.AreEqual(key, resKey); }
private void MainForm_Load(object sender, EventArgs e) { if (client.GetLicenseKey() != null) { client.SetAutoRun(Application.ExecutablePath, true); client.IP = (Settings.Default.ip == "")?"127.0.0.1": Settings.Default.ip; client.Port = (Settings.Default.port == 0) ? 11000 : Settings.Default.port; if (client.Connect()) { if (client.Login()) { } else { } } else { while (client.Connect()) { Thread.Sleep(1000); } } } else { ActivateForm aForm = new ActivateForm(); if (aForm.ShowDialog() == DialogResult.OK) { Exit(); } else { Exit(); } } // client.SetAutoRun(Application.ExecutablePath, true); //автозапуск программы при старте Windows }