コード例 #1
0
        void FormMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            //关闭Http服务器
            NdaHttpServer.StopServer();

            Process.GetCurrentProcess().Kill();
            System.Environment.Exit(0);
        }
コード例 #2
0
        private void StartHttpServer()
        {
            string ip   = SysConfig.ServerIP;
            int    port = SysConfig.ServerPort;

            if (ip != null && ip.Length > 0)
            {
                NdaHttpServer.StartServer(ip, port);
            }
        }
コード例 #3
0
        private void timerServer_Tick(object sender, EventArgs e)
        {
            bool succeed = NdaHttpServer.TestServer();

            this.toolStripStatusLabelServerStatus.Text = "服务接口状态(" + SysConfig.ServerIP + ":" + SysConfig.ServerPort.ToString() + "): " + (succeed ? "正常" : "无服务");
        }