private void runAfraidDNSUpdate()
 {
     if (afraidDNSSettings.Hosts.Any() && !string.IsNullOrEmpty(afraidDNSSettings.Login) && !string.IsNullOrEmpty(afraidDNSSettings.Password) && afraidDNSSettings.Enabled)
     {
         string messages = AfraidDNSHelper.RunUpdates(afraidDNSSettings);
         parseMessagesAndShowResults(messages);
     }
 }
示例#2
0
        private void retreiveHostsButton_Click(object sender, EventArgs e)
        {
            AfraidDNSSettings temp = new AfraidDNSSettings();

            temp.Login    = freeDNSLogin.Text;
            temp.Password = freeDNSPass.Text;
            var hosts = AfraidDNSHelper.CurrentHosts(temp);

            if (hosts.Any())
            {
                freeDNSHosts.Items.Clear();
                foreach (var host in hosts)
                {
                    freeDNSHosts.Items.Add(host.entry);
                }
            }
            else
            {
                MessageBox.Show("Failed to retrieve hosts from " + AfraidDNSHelper.serviceName + "! Please make sure you've entered your login and password." + Environment.NewLine + Environment.NewLine + AfraidDNSHelper.errorMessage, "Generic Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        private void saveFreeDNSSettings()
        {
            AfraidDNSSettings aSettings = new AfraidDNSSettings();

            aSettings.Enabled = freeDNSEnable.Checked;
            aSettings.Hosts   = freeDNSHosts.Items.Cast <String>().ToList();
            aSettings.Login   = freeDNSLogin.Text;

            var success = AfraidDNSHelper.SaveOptions(aSettings, this);

            if (string.IsNullOrEmpty(success))
            {
                successCount++;
                saveSuccess += "Your " + AfraidDNSHelper.serviceName + " settings were successfully saved! \n";
            }
            else
            {
                customError err = new customError("You have the following problems with your " + AfraidDNSHelper.serviceName + " Settings!", success);
                err.intervalForTimer = 30000;
                err.Show();
                errorCount++;
            }
        }
        private void getSavedOptions()
        {
            appSettings = AppHelper.LoadOptions();

            // Reading Saved Options:
            switch (appSettings.TimeIntervalMode)
            {
            default:
            case 1:
                timer1.Interval = appSettings.TimeInterval * 1000;
                break;

            case 2:
                timer1.Interval = appSettings.TimeInterval * 1000 * 60;
                break;

            case 3:
                timer1.Interval = appSettings.TimeInterval * 1000 * 3600;
                break;
            }

            if (appSettings.AutoStart)
            {
                timer1.Enabled         = true;
                timer2.Enabled         = true;
                scanButton.Visible     = false;
                stopScanButton.Visible = true;
            }
            else
            {
                timer1.Enabled         = false;
                timer2.Enabled         = false;
                scanButton.Visible     = true;
                stopScanButton.Visible = false;
            }

            switch (appSettings.IPService)
            {
            case 1:
                urlForIPCheck = "https://dynamix.run/ip.php";
                break;

            case 3:
                urlForIPCheck = "http://dinofly.com/misc/ipcheck.php";
                break;

            case 2:
                urlForIPCheck = "http://grabip.tk";
                break;

            default:
                urlForIPCheck = "https://dynamix.run/ip.php";
                break;
            }


            if (File.Exists(phpPathFile))
            {
                phpPath = File.ReadAllText(phpPathFile);
            }

            if (appSettings.RunDynamicServices)
            {
                XpertDNSSettings  = XpertDNSHelper.LoadOptions();
                dynamixSettings   = DynamixHelper.LoadOptions();
                afraidDNSSettings = AfraidDNSHelper.LoadOptions();
                noIPDNSSettings   = NoIPHelper.LoadOptions();
            }
        }
示例#5
0
 private void getFreeDNSSettings()
 {
     afraidDNSSettings = AfraidDNSHelper.LoadOptions(this);
 }