示例#1
0
        public void GetServer()
        {
            try
            {
                DisableButtons();
                bool   ServerChk = HostsCore.gethosts().Any(x => x.Contains("osu.ppy.sh") && !x.Contains("#"));
                string serverChk = Convert.ToString(ServerChk);
                if (serverChk == "True")
                {
                    materialLabel1.Text = "Welcome To Debian!";
                }
                if (serverChk == "False")
                {
                    materialLabel1.Text = "Connecting Debian?";
                }
            }
            catch (Exception ex)
            {
                LogCore.Log(ex);

                MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "Novah", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                Process.Start(filepath);
                Environment.Exit(0);
            }
            finally { EnableButtons(); }
        }
示例#2
0
        private void flatButton1_Click(object sender, EventArgs e)
        {
            Application.DoEvents();

            CertificateCore.UninstallCertificates();

            List <string> hosts = HostsCore.gethosts().ToList();

            hosts.RemoveAll(x => x.Contains(".ppy.sh"));
            HostsCore.changehosts(hosts.ToArray());
            string[] osu_domains = new string[]
            {
                "osu.ppy.sh",
                "c.ppy.sh",
                "c1.ppy.sh",
                "c2.ppy.sh",
                "c3.ppy.sh",
                "c4.ppy.sh",
                "c5.ppy.sh",
                "c6.ppy.sh",
                "ce.ppy.sh",
                "a.ppy.sh",
                "i.ppy.sh",
            };
            hosts = HostsCore.gethosts().ToList();
            foreach (string domain in osu_domains)
            {
                hosts.Add(ServerIP + " " + domain);
            }
            HostsCore.changehosts(hosts.ToArray());

            CertificateCore.InstallCertificate();

            materialLabel1.Text = "Welcome To Debian!";
        }
示例#3
0
 private void UninstallCerts()
 {
     try
     {
         HostsCore.removehosts();
         CertificateCore.UninstallCertificates();
     }
     catch { MessageBox.Show("REMOVE CERTIFICATE FAILED"); }
 }
示例#4
0
        private void flatButton2_Click(object sender, EventArgs e)
        {
            try
            {
                string[] _hosts = HostsCore.gethosts();
                _hosts = _hosts.Where(x => !x.Contains(".ppy.sh")).ToArray();
                HostsCore.changehosts(_hosts);
                materialLabel1.Text = "Connecting Debian?";
                CertificateCore.UninstallCertificates();
            }
            catch (Exception ex)
            {
                LogCore.Log(ex);

                MessageBox.Show("Error! \r\rPlease Send Discrod Nerina#4444 the Switcher Logs", "NOVAH", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string filepath = Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\novahlog.txt";
                Process.Start(filepath);
                Environment.Exit(0);
            }
        }