Example #1
0
        public static string ExternalIPv4(bool refresh)
        {
            if (_externalIP != "" && !refresh)
            {
                return(_externalIP);
            }
            if (WebsiteLive)
            {
                try
                {
                    _externalIP = Wsa.RemoteAddress();
                }
                catch (Exception ex)
                {
                    Log.Error("", ex);//MainForm.LogExceptionToFile(ex);
                    WebsiteLive = false;
                }
                if (WebsiteLive)
                {
                    return(_externalIP);
                }
            }
            if (_externalIP != "")
            {
                return(_externalIP);
            }

            return(LocRm.GetString("Unavailable"));
        }
Example #2
0
        public static string ExternalIPv4(bool refresh)
        {
            if (_externalIP != "" && !refresh)
            {
                return(_externalIP);
            }
            if (WebsiteLive)
            {
                try
                {
                    Debug.WriteLine("WEBSERVICE CALL: RemoteAddress");
                    _externalIP = Wsa.RemoteAddress();
                }
                catch (Exception ex)
                {
                    MainForm.LogExceptionToFile(ex);
                    WebsiteLive = false;
                }
                if (WebsiteLive)
                {
                    return(_externalIP);
                }
            }
            if (_externalIP != "")
            {
                return(_externalIP);
            }

            return(LocRm.GetString("Unavailable"));
        }
Example #3
0
        public static string ExternalIPv4(bool refresh, out bool success)
        {
            if (_externalIP != "" && !refresh)
            {
                success = true;
                return(_externalIP);
            }
            if (WebsiteLive || refresh)
            {
                try
                {
                    Debug.WriteLine("WEBSERVICE CALL: RemoteAddress");
                    _externalIP = Wsa.RemoteAddress();
                    WebsiteLive = true;
                }
                catch (Exception ex)
                {
                    Logger.LogExceptionToFile(ex, "Webservices");
                    WebsiteLive = false;
                }
                if (WebsiteLive)
                {
                    success = true;
                    return(_externalIP);
                }
            }
            if (_externalIP != "")
            {
                success = true;
                return(_externalIP);
            }

            success = false;
            return(LocRm.GetString("Unavailable"));
        }