private void ActivateServers() { AddLog("Trying to activate servers..."); fEchoServer = new EchoServer(); try { fEchoServer.Open(); AddLog("EchoServer is active."); } catch (Exception ex) { AddLog("Can't activate EchoServer. An exception occured: " + ex.Message); } fHttpServer = new SimpleHttpServer(); fHttpServer.Port = Convert.ToInt32(nudPort.Value); fHttpServer.RootPath = txtRoot.Text; fHttpServer.ServerName = txtServerName.Text; if (this.fHttpServer.BindingV4 != null) { this.fHttpServer.BindingV4.ListenerThreadCount = Convert.ToInt32(this.nudCount.Value); } fHttpServer.HttpRequest += OnHttpRequest; fHttpServer.Open(); AddLog(String.Format("SimpleHttpServer is active on {0} port.", fHttpServer.Port)); SetEnable(false); AddLog("Servers activated."); btnAction.Text = "Deactivate Servers"; }