private void PortsFrm_Load(object sender, EventArgs e) { _ = Methods.FadeIn(this, 5); if (Properties.Settings.Default.Ports.Length == 0) { listBox1.Items.AddRange(new object[] { "6606", "7707", "8808" }); } else { try { string[] ports = Properties.Settings.Default.Ports.Split(new[] { "," }, StringSplitOptions.None); foreach (string item in ports) { if (!string.IsNullOrWhiteSpace(item)) { listBox1.Items.Add(item.Trim()); } } } catch { } } this.Text = $"{Settings.Version} | Welcome {Environment.UserName}"; if (!File.Exists(Settings.CertificatePath)) { using (FormCertificate formCertificate = new FormCertificate()) { formCertificate.ShowDialog(); } } else { Settings.ServerCertificate = new X509Certificate2(Settings.CertificatePath); } }
private void PortsFrm_Load(object sender, EventArgs e) { Methods.FadeIn(this, 5); textPorts.Text = "6606, 7707, 8808"; if (Properties.Settings.Default.Ports.Length > 0) { textPorts.Text = Properties.Settings.Default.Ports; } this.Text = $"{Settings.Version} | Welcome {Environment.UserName}"; if (!File.Exists(Settings.CertificatePath)) { using (FormCertificate formCertificate = new FormCertificate()) { formCertificate.ShowDialog(); } } else { Settings.ServerCertificate = new X509Certificate2(Settings.CertificatePath); } }