iSpyApplication.MainForm.StopAndStartServer C# (CSharp) Method

StopAndStartServer() static private method

static private StopAndStartServer ( ) : string
return string
        internal static string StopAndStartServer()
        {
            string message = "";
            try
            {
                MWS.StopServer();
            }
            catch (Exception ex)
            {
                Logger.LogExceptionToFile(ex);
            }

            Application.DoEvents();
            try
            {
                message = MWS.StartServer();
            }
            catch (Exception ex)
            {
                Logger.LogExceptionToFile(ex);
            }
            return message;
        }

Usage Example

Exemplo n.º 1
0
        static void WsaPingAliveCompleted(object sender, PingAliveCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                string[] r = e.Result;

                if (r.Length > 1)
                {
                    if (MainForm.Conf.ServicesEnabled)
                    {
                        if (!MainForm.MWS.Running)
                        {
                            MainForm.StopAndStartServer();
                        }
                    }

                    WebsiteLive = true;

                    if (MainForm.Conf.IPMode == "IPv4")
                    {
                        _externalIP = r[1];
                    }
                }
                else
                {
                    WebsiteLive = false;
                }
            }
            else
            {
                WebsiteLive = false;
            }
        }
All Usage Examples Of iSpyApplication.MainForm::StopAndStartServer
MainForm