Beispiel #1
0
        void ipHelper_QueryExternalIPAsync_Completed(object sender, Network.IPHelper.GetExternalIPEventArgs e)
        {
            if (e.HasChanged)
            {
                Functions.WriteLineToLogFile("DNSHelper: External IP address changed...");

                // Update DynDNS
                DynDnsUpdateResult result = DynDnsUpdateResult.LocalError;
                try
                {
                    result = NotifyDynDNS(e.IP);

                    Functions.WriteLineToLogFile("DNSHelper: Notify Dyndns result: " + result.ToString());
                }
                catch (Exception ex)
                {
                    Functions.WriteLineToLogFile("DNSHelper: Could not notify DynDNS: ");
                    Functions.WriteExceptionToLogFile(ex);
                }
            }
            else
            {
                if (Settings.Default.DebugAdvanced)
                {
                    Functions.WriteLineToLogFile("DNSHelper: External IP address has NOT changed.");
                }
            }
        }
Beispiel #2
0
        public string ErrorMessageForResult(DynDnsUpdateResult result)
        {
            switch (result)
            {
                case DynDnsUpdateResult.BadAuth:
                    return "The username and/or password was incorrect.";

                case DynDnsUpdateResult.LocalError:
                    return "An error in Remote Potato stopped the request being made.";

                case DynDnsUpdateResult.HostSyntaxError:
                    return "The host name should be a fully qualified domain name, for example:  yourname.dyndns.org ";

                case DynDnsUpdateResult.NoUpdateSameIp:
                    return "Your IP address is already updated, no change was made.  Avoid doing this repeatedly.";

                case DynDnsUpdateResult.RemoteError:
                    return "An error occurred on the remote server.";

                case DynDnsUpdateResult.HostNotExist:
                    return "The host name was incorrect - please check it and try again.";

                case DynDnsUpdateResult.HostNotYours:
                    return "The host name does not belong to the account used; please check all login details and try again.";

                case DynDnsUpdateResult.BadAgent:
                    return "This user agent has been blocked - please contact [email protected] to let us know about this incident.";

                case DynDnsUpdateResult.UpdatedIp:
                    return "OK";
            }

            return "Unknown result.";
        }
Beispiel #3
0
        public string ErrorMessageForResult(DynDnsUpdateResult result)
        {
            switch (result)
            {
            case DynDnsUpdateResult.BadAuth:
                return("The username and/or password was incorrect.");

            case DynDnsUpdateResult.LocalError:
                return("An error in Remote Potato stopped the request being made.");

            case DynDnsUpdateResult.HostSyntaxError:
                return("The host name should be a fully qualified domain name, for example:  yourname.dyndns.org ");

            case DynDnsUpdateResult.NoUpdateSameIp:
                return("Your IP address is already updated, no change was made.  Avoid doing this repeatedly.");

            case DynDnsUpdateResult.RemoteError:
                return("An error occurred on the remote server.");

            case DynDnsUpdateResult.HostNotExist:
                return("The host name was incorrect - please check it and try again.");

            case DynDnsUpdateResult.HostNotYours:
                return("The host name does not belong to the account used; please check all login details and try again.");

            case DynDnsUpdateResult.BadAgent:
                return("This user agent has been blocked - please contact [email protected] to let us know about this incident.");

            case DynDnsUpdateResult.UpdatedIp:
                return("OK");
            }

            return("Unknown result.");
        }