コード例 #1
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            txthostname.Text       = HostSettingConfig.GetValue("hostname");
            ckdebug.Checked        = HostSettingConfig.GetValue("debug") == "1" ? true : false;
            ckwcf.Checked          = HostSettingConfig.GetValue("wcfservice") == "1" ? true : false;
            ckrouter.Checked       = HostSettingConfig.GetValue("router") == "1" ? true : false;
            ckfile.Checked         = HostSettingConfig.GetValue("filetransfer") == "1" ? true : false;
            ckheartbeat.Checked    = HostSettingConfig.GetValue("heartbeat") == "1" ? true : false;
            txtheartbeattime.Text  = HostSettingConfig.GetValue("heartbeattime");
            ckmessage.Checked      = HostSettingConfig.GetValue("message") == "1" ? true : false;
            txtmessagetime.Text    = HostSettingConfig.GetValue("messagetime");
            ckJsoncompress.Checked = HostSettingConfig.GetValue("compress") == "1" ? true : false;
            ckEncryption.Checked   = HostSettingConfig.GetValue("encryption") == "1" ? true : false;
            ckovertime.Checked     = HostSettingConfig.GetValue("overtime") == "1" ? true : false;
            txtovertime.Text       = HostSettingConfig.GetValue("overtimetime");


            //读取配置文件
            xmldoc_entlib = new XmlDocument();
            xmldoc_app    = new XmlDocument();
            xmldoc_entlib.Load(entlibconfig);
            xmldoc_app.Load(appconfig);

            XmlNode node;

            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.WCFHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                string address = node.Attributes["baseAddress"].Value;
                txtwcf.Text = address;
            }

            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.RouterHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                string address = node.Attributes["baseAddress"].Value;
                txtrouter.Text = address;
            }

            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.FileTransferHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                string address = node.Attributes["baseAddress"].Value;
                txtfile.Text = address;
            }

            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.WebAPIHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                string address = node.Attributes["baseAddress"].Value;
                txtweb.Text = address;
            }

            node = xmldoc_entlib.DocumentElement.SelectSingleNode("connectionStrings");
            if (node != null)
            {
                string connectionString = node.InnerXml;
                txtconnstr.Text = connectionString;
            }
        }
コード例 #2
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            txthostname.Text              = HostSettingConfig.GetValue("hostname");
            ckdebug.Checked               = HostSettingConfig.GetValue("debug") == "1" ? true : false;
            ckwcf.Checked                 = HostSettingConfig.GetValue("wcfservice") == "1" ? true : false;
            ckrouter.Checked              = HostSettingConfig.GetValue("router") == "1" ? true : false;
            ckfile.Checked                = HostSettingConfig.GetValue("filetransfer") == "1" ? true : false;
            ckWebapi.Checked              = HostSettingConfig.GetValue("webapi") == "1" ? true : false;
            ckheartbeat.Checked           = HostSettingConfig.GetValue("heartbeat") == "1" ? true : false;
            txtheartbeattime.Text         = HostSettingConfig.GetValue("heartbeattime");
            ckmessage.Checked             = HostSettingConfig.GetValue("message") == "1" ? true : false;
            txtmessagetime.Text           = HostSettingConfig.GetValue("messagetime");
            ckJsoncompress.Checked        = HostSettingConfig.GetValue("compress") == "1" ? true : false;
            ckEncryption.Checked          = HostSettingConfig.GetValue("encryption") == "1" ? true : false;
            ckovertime.Checked            = HostSettingConfig.GetValue("overtime") == "1" ? true : false;
            txtovertime.Text              = HostSettingConfig.GetValue("overtimetime");
            cbSerializeType.SelectedIndex = Convert.ToInt32(HostSettingConfig.GetValue("serializetype"));

            txtwcf.Text        = HostAddressConfig.GetWcfAddress();
            txtfile.Text       = HostAddressConfig.GetFileAddress();
            txtrouter.Text     = HostAddressConfig.GetRouterAddress();
            txtfilerouter.Text = HostAddressConfig.GetfileRouterAddress();
            txtwcfurl.Text     = HostAddressConfig.GetClientWcfAddress();
            txtfileurl.Text    = HostAddressConfig.GetClientFileAddress();
            txtweb.Text        = HostAddressConfig.GetWebapiAddress();

            txtconnstr.Text = HostDataBaseConfig.GetConnString();
        }
コード例 #3
0
        private void StartAppHost()
        {
            WcfServerManage.hostwcfclientinfoList = new HostWCFClientInfoListHandler(BindGridClient);
            WcfServerManage.hostwcfMsg            = new HostWCFMsgHandler(AddMsg);
            DistributedCacheManage.hostwcfMsg     = new HostWCFMsgHandler(AddMsg);

            mAppHost = new ServiceHost(typeof(WCFHandlerService));


            WcfServerManage.Identify         = identify;
            WcfServerManage.HostName         = HostSettingConfig.GetValue("hostname");
            WcfServerManage.IsDebug          = HostSettingConfig.GetValue("debug") == "1" ? true : false;
            WcfServerManage.IsHeartbeat      = HostSettingConfig.GetValue("heartbeat") == "1" ? true : false;
            WcfServerManage.HeartbeatTime    = Convert.ToInt32(HostSettingConfig.GetValue("heartbeattime"));
            WcfServerManage.IsMessage        = HostSettingConfig.GetValue("message") == "1" ? true : false;
            WcfServerManage.MessageTime      = Convert.ToInt32(HostSettingConfig.GetValue("messagetime"));
            WcfServerManage.IsCompressJson   = HostSettingConfig.GetValue("compress") == "1" ? true : false;
            WcfServerManage.IsEncryptionJson = HostSettingConfig.GetValue("encryption") == "1" ? true : false;
            WcfServerManage.serializeType    = (SerializeType)Convert.ToInt32(HostSettingConfig.GetValue("serializetype"));
            WcfServerManage.IsOverTime       = HostSettingConfig.GetValue("overtime") == "1" ? true : false;
            WcfServerManage.OverTime         = Convert.ToInt32(HostSettingConfig.GetValue("overtimetime"));
            WcfServerManage.StartWCFHost();

            mAppHost.Open();
            WcfServerManage.CreateSuperClient();

            AddMsg(Color.Blue, DateTime.Now, "基础服务启动完成");
        }
コード例 #4
0
ファイル: TimeCDKEY.cs プロジェクト: hongfagj/efwplus
        /*读取注册表*/
        public static string ReadSetting()
        {
            string key1 = HostSettingConfig.GetValue("cdkey");

            if (key1 != "")
            {
                return(Encryption.DisEncryPW(key1, "kakake!@#123"));
            }
            return("-1");
        }
コード例 #5
0
        private void btnSetting_Click(object sender, EventArgs e)
        {
            FrmSetting set = new FrmSetting();

            set.ShowDialog();
            if (set.isOk == true)
            {
                this.Text             = "efwplusServer 云医院中间件【" + HostSettingConfig.GetValue("hostname") + "】";
                this.notifyIcon1.Text = this.Text;
            }
        }
コード例 #6
0
        private void FrmHosting_Load(object sender, EventArgs e)
        {
            this.Text = "efwplusServer 云医院中间件【" + HostSettingConfig.GetValue("hostname") + "】";
            this.notifyIcon1.Visible = true;
            this.notifyIcon1.Icon    = this.Icon;
            this.notifyIcon1.Text    = this.Text;

            RunState         = HostState.NoOpen;
            lsServerUrl.Text = ReadConfig.GetWcfServerUrl();
            btnStart_Click(null, null);//打开服务主机后自动启动服务
        }
コード例 #7
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            HostSettingConfig.SetValue("hostname", txthostname.Text);
            HostSettingConfig.SetValue("debug", ckdebug.Checked ? "1" : "0");
            HostSettingConfig.SetValue("wcfservice", ckwcf.Checked ? "1" : "0");
            HostSettingConfig.SetValue("router", ckrouter.Checked ? "1" : "0");
            HostSettingConfig.SetValue("filetransfer", ckfile.Checked ? "1" : "0");
            HostSettingConfig.SetValue("heartbeat", ckheartbeat.Checked ? "1" : "0");
            HostSettingConfig.SetValue("heartbeattime", txtheartbeattime.Text);
            HostSettingConfig.SetValue("message", ckmessage.Checked ? "1" : "0");
            HostSettingConfig.SetValue("messagetime", txtmessagetime.Text);
            HostSettingConfig.SetValue("compress", ckJsoncompress.Checked ? "1" : "0");
            HostSettingConfig.SetValue("encryption", ckEncryption.Checked ? "1" : "0");
            HostSettingConfig.SetValue("overtime", ckovertime.Checked ? "1" : "0");
            HostSettingConfig.SetValue("overtimetime", txtovertime.Text);
            HostSettingConfig.SaveConfig();

            XmlNode node;

            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.WCFHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                node.Attributes["baseAddress"].Value = txtwcf.Text;
            }
            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.RouterHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                node.Attributes["baseAddress"].Value = txtrouter.Text;
            }
            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.FileTransferHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                node.Attributes["baseAddress"].Value = txtfile.Text;
            }
            node = xmldoc_app.DocumentElement.SelectSingleNode("system.serviceModel/services/service[@name='EFWCoreLib.WcfFrame.WcfService.WebAPIHandlerService']/host/baseAddresses/add");
            if (node != null)
            {
                node.Attributes["baseAddress"].Value = txtweb.Text;
            }
            node = xmldoc_entlib.DocumentElement.SelectSingleNode("connectionStrings");
            if (node != null)
            {
                node.InnerXml = txtconnstr.Text;
            }
            xmldoc_app.Save(appconfig);
            xmldoc_entlib.Save(entlibconfig);

            isOk = true;
            MessageBox.Show("保存参数后,需重启程序才会生效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
コード例 #8
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            HostSettingConfig.SetValue("hostname", txthostname.Text);
            HostSettingConfig.SetValue("rootmnode", ckRoot.Checked ? "1" : "0");
            HostSettingConfig.SetValue("debug", ckdebug.Checked ? "1" : "0");
            HostSettingConfig.SetValue("timingtask", cktask.Checked ? "1" : "0");
            HostSettingConfig.SetValue("wcfservice", ckwcf.Checked ? "1" : "0");
            HostSettingConfig.SetValue("router", ckrouter.Checked ? "1" : "0");
            HostSettingConfig.SetValue("filetransfer", ckfile.Checked ? "1" : "0");
            HostSettingConfig.SetValue("webapi", ckWebapi.Checked ? "1" : "0");
            HostSettingConfig.SetValue("mongodb", ckmongo.Checked ? "1" : "0");
            HostSettingConfig.SetValue("mongodb_binpath", txtmongobinpath.Text);
            HostSettingConfig.SetValue("mongodb_conn", txtmongodb_conn.Text);
            HostSettingConfig.SetValue("heartbeat", ckheartbeat.Checked ? "1" : "0");
            HostSettingConfig.SetValue("heartbeattime", txtheartbeattime.Text);
            HostSettingConfig.SetValue("message", ckmessage.Checked ? "1" : "0");
            HostSettingConfig.SetValue("messagetime", txtmessagetime.Text);
            HostSettingConfig.SetValue("compress", ckJsoncompress.Checked ? "1" : "0");
            HostSettingConfig.SetValue("encryption", ckEncryption.Checked ? "1" : "0");
            HostSettingConfig.SetValue("token", cktoken.Checked ? "1" : "0");
            HostSettingConfig.SetValue("overtime", ckovertime.Checked ? "1" : "0");
            HostSettingConfig.SetValue("overtimetime", txtovertime.Text);
            HostSettingConfig.SetValue("serializetype", cbSerializeType.SelectedIndex.ToString());
            HostSettingConfig.SetValue("nginx", ckNginx.Checked ? "1" : "0");
            HostSettingConfig.SaveConfig();


            HostAddressConfig.SetWcfAddress(txtwcf.Text);
            HostAddressConfig.SetFileAddress(txtfile.Text);
            HostAddressConfig.SetRouterAddress(txtrouter.Text);
            HostAddressConfig.SetfileRouterAddress(txtfilerouter.Text);
            HostAddressConfig.SetClientWcfAddress(txtwcfurl.Text);
            HostAddressConfig.SetClientFileAddress(txtfileurl.Text);
            HostAddressConfig.SetClientLocalAddress(txtlocalurl.Text);
            //HostAddressConfig.SetWebapiAddress(txtweb.Text);
            //HostAddressConfig.SetWebapiClientBase(txtclientwcf.Text);
            //HostAddressConfig.SetWebapiClientFile(txtclientfile.Text);
            HostAddressConfig.SetUpdaterUrl(txtupdate.Text);
            HostAddressConfig.SaveConfig();


            HostDataBaseConfig.SetConnString(txtconnstr.Text);
            HostDataBaseConfig.SaveConfig();

            HostMongoDBConfig.SetConfig(txtMongodb.Text);//保存mongodb配置文件

            isOk = true;
            MessageBox.Show("保存参数后,需重启程序才会生效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
コード例 #9
0
ファイル: FrmHosting.cs プロジェクト: vivigiggle409/MicroCMIP
        private void FrmHosting_Load(object sender, EventArgs e)
        {
            tabMain.TabPages.RemoveAt(2);
            tabMain.TabPages.RemoveAt(1);


            this.Text = "MicroCMIP 微云医疗信息平台【" + HostSettingConfig.GetValue("hostname") + "】";
            this.notifyIcon1.Visible = true;
            this.notifyIcon1.Icon    = this.Icon;
            this.notifyIcon1.Text    = this.Text;

            RunState         = HostState.NoOpen;
            lsServerUrl.Text = "http://localhost:8088/Monitor/index.html";
            btnStart_Click(null, null);//打开服务主机后自动启动服务
        }
コード例 #10
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            int res = TimeCDKEY.InitRegedit(out expireDate, out identify);

            if (res == 0)
            {
                //AddMsg(Color.Green, DateTime.Now, "软件已注册,到期时间【" + expireDate + "】");
                settext(Color.Green, "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] : " + "软件已注册,到期时间【" + expireDate + "】");
                if (Convert.ToInt32(HostSettingConfig.GetValue("wcfservice")) == 1)
                {
                    StartAppHost();
                }
                if (Convert.ToInt32(HostSettingConfig.GetValue("router")) == 1)
                {
                    StartRouterHost();
                }
                if (Convert.ToInt32(HostSettingConfig.GetValue("filetransfer")) == 1)
                {
                    StartFileHost();
                }
                if (Convert.ToInt32(HostSettingConfig.GetValue("webapi")) == 1)
                {
                    StartWebApiHost();
                }

                RunState = HostState.Opened;
            }
            else if (res == 1)
            {
                //AddMsg(Color.Red, DateTime.Now, "软件尚未注册,请注册软件!");
                settext(Color.Red, "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] : " + "软件尚未注册,请注册软件!");
            }
            else if (res == 2)
            {
                //AddMsg(Color.Red, DateTime.Now, "注册机器与本机不一致,请联系管理员!");
                settext(Color.Red, "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] : " + "注册机器与本机不一致,请联系管理员!");
            }
            else if (res == 3)
            {
                //AddMsg(Color.Red, DateTime.Now, "软件试用已到期!");
                settext(Color.Red, "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] : " + "软件试用已到期!");
            }
            else
            {
                //AddMsg(Color.Red, DateTime.Now, "软件运行出错,请重新启动!");
                settext(Color.Red, "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] : " + "软件运行出错,请重新启动!");
            }
        }
コード例 #11
0
ファイル: FrmHosting.cs プロジェクト: hongfagj/efwplus
        private void StartAllHost()
        {
            WcfGlobal.Identify = identify;
            EFWCoreLib.WcfFrame.ServerManage.ClientManage.clientinfoList = new ClientInfoListHandler(BindGridClient);
            EFWCoreLib.WcfFrame.ServerManage.RouterManage.hostwcfRouter  = new HostWCFRouterListHandler(BindGridRouter);

            WcfGlobal.Main();

            if (Convert.ToInt32(HostSettingConfig.GetValue("webapi")) == 1)
            {
                WebApiGlobal.IsToken = HostSettingConfig.GetValue("token") == "1" ? true : false;
                WebApiGlobal.Main();
            }

            RunState = HostState.Opened;
        }
コード例 #12
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            txthostname.Text              = HostSettingConfig.GetValue("hostname");
            ckRoot.Checked                = HostSettingConfig.GetValue("rootmnode") == "1" ? true : false;
            ckdebug.Checked               = HostSettingConfig.GetValue("debug") == "1" ? true : false;
            cktask.Checked                = HostSettingConfig.GetValue("timingtask") == "1" ? true : false;
            ckwcf.Checked                 = HostSettingConfig.GetValue("wcfservice") == "1" ? true : false;
            ckrouter.Checked              = HostSettingConfig.GetValue("router") == "1" ? true : false;
            ckfile.Checked                = HostSettingConfig.GetValue("filetransfer") == "1" ? true : false;
            ckWebapi.Checked              = HostSettingConfig.GetValue("webapi") == "1" ? true : false;
            ckmongo.Checked               = HostSettingConfig.GetValue("mongodb") == "1" ? true : false;
            ckheartbeat.Checked           = HostSettingConfig.GetValue("heartbeat") == "1" ? true : false;
            txtheartbeattime.Text         = HostSettingConfig.GetValue("heartbeattime");
            ckmessage.Checked             = HostSettingConfig.GetValue("message") == "1" ? true : false;
            txtmessagetime.Text           = HostSettingConfig.GetValue("messagetime");
            ckJsoncompress.Checked        = HostSettingConfig.GetValue("compress") == "1" ? true : false;
            ckEncryption.Checked          = HostSettingConfig.GetValue("encryption") == "1" ? true : false;
            cktoken.Checked               = HostSettingConfig.GetValue("token") == "1" ? true : false;
            ckovertime.Checked            = HostSettingConfig.GetValue("overtime") == "1" ? true : false;
            txtovertime.Text              = HostSettingConfig.GetValue("overtimetime");
            cbSerializeType.SelectedIndex = Convert.ToInt32(HostSettingConfig.GetValue("serializetype"));
            ckNginx.Checked               = HostSettingConfig.GetValue("nginx") == "1" ? true : false;

            txtwcf.Text        = HostAddressConfig.GetWcfAddress();
            txtfile.Text       = HostAddressConfig.GetFileAddress();
            txtrouter.Text     = HostAddressConfig.GetRouterAddress();
            txtfilerouter.Text = HostAddressConfig.GetfileRouterAddress();
            txtwcfurl.Text     = HostAddressConfig.GetClientWcfAddress();
            txtfileurl.Text    = HostAddressConfig.GetClientFileAddress();
            txtlocalurl.Text   = HostAddressConfig.GetClientLocalAddress();
            //txtweb.Text = HostAddressConfig.GetWebapiAddress();
            //txtclientwcf.Text = HostAddressConfig.GetWebapiClientBase();
            //txtclientfile.Text = HostAddressConfig.GetWebapiClientFile();
            txtupdate.Text = HostAddressConfig.GetUpdaterUrl();

            txtconnstr.Text      = HostDataBaseConfig.GetConnString();
            txtmongobinpath.Text = HostSettingConfig.GetValue("mongodb_binpath");
            txtmongodb_conn.Text = HostSettingConfig.GetValue("mongodb_conn");
            txtMongodb.Text      = HostMongoDBConfig.GetConfig();
        }
コード例 #13
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            string expireDate;
            int    res = TimeCDKEY.InitRegedit(out expireDate);

            if (res == 0)
            {
                AddMsg(Color.Green, DateTime.Now, "软件已注册,到期时间【" + expireDate + "】");
                if (Convert.ToInt32(HostSettingConfig.GetValue("wcfservice")) == 1)
                {
                    StartAppHost();
                }
                if (Convert.ToInt32(HostSettingConfig.GetValue("router")) == 1)
                {
                    StartRouterHost();
                }
                if (Convert.ToInt32(HostSettingConfig.GetValue("filetransfer")) == 1)
                {
                    StartFileHost();
                }
                RunState = HostState.Opened;
            }
            else if (res == 1)
            {
                AddMsg(Color.Red, DateTime.Now, "软件尚未注册,请注册软件!");
            }
            else if (res == 2)
            {
                AddMsg(Color.Red, DateTime.Now, "注册机器与本机不一致,请联系管理员!");
            }
            else if (res == 3)
            {
                AddMsg(Color.Red, DateTime.Now, "软件试用已到期!");
            }
            else
            {
                AddMsg(Color.Red, DateTime.Now, "软件运行出错,请重新启动!");
            }
        }
コード例 #14
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            HostSettingConfig.SetValue("hostname", txthostname.Text);
            HostSettingConfig.SetValue("debug", ckdebug.Checked ? "1" : "0");
            HostSettingConfig.SetValue("wcfservice", ckwcf.Checked ? "1" : "0");
            HostSettingConfig.SetValue("router", ckrouter.Checked ? "1" : "0");
            HostSettingConfig.SetValue("filetransfer", ckfile.Checked ? "1" : "0");
            HostSettingConfig.SetValue("webapi", ckWebapi.Checked ? "1" : "0");
            HostSettingConfig.SetValue("heartbeat", ckheartbeat.Checked ? "1" : "0");
            HostSettingConfig.SetValue("heartbeattime", txtheartbeattime.Text);
            HostSettingConfig.SetValue("message", ckmessage.Checked ? "1" : "0");
            HostSettingConfig.SetValue("messagetime", txtmessagetime.Text);
            HostSettingConfig.SetValue("compress", ckJsoncompress.Checked ? "1" : "0");
            HostSettingConfig.SetValue("encryption", ckEncryption.Checked ? "1" : "0");
            HostSettingConfig.SetValue("overtime", ckovertime.Checked ? "1" : "0");
            HostSettingConfig.SetValue("overtimetime", txtovertime.Text);
            HostSettingConfig.SetValue("serializetype", cbSerializeType.SelectedIndex.ToString());
            HostSettingConfig.SaveConfig();


            HostAddressConfig.SetWcfAddress(txtwcf.Text);
            HostAddressConfig.SetFileAddress(txtfile.Text);
            HostAddressConfig.SetRouterAddress(txtrouter.Text);
            HostAddressConfig.SetfileRouterAddress(txtfilerouter.Text);
            HostAddressConfig.SetClientWcfAddress(txtwcfurl.Text);
            HostAddressConfig.SetClientFileAddress(txtfileurl.Text);
            HostAddressConfig.SetWebapiAddress(txtweb.Text);
            HostAddressConfig.SaveConfig();


            HostDataBaseConfig.SetConnString(txtconnstr.Text);
            HostDataBaseConfig.SaveConfig();

            isOk = true;
            MessageBox.Show("保存参数后,需重启程序才会生效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
コード例 #15
0
ファイル: TimeCDKEY.cs プロジェクト: hongfagj/efwplus
 /*写入注册表*/
 public static void WriteSetting(string Setting)
 {
     HostSettingConfig.SetValue("cdkey", Setting);
     HostSettingConfig.SaveConfig();
 }
コード例 #16
0
        private void FrmInfo_Load(object sender, EventArgs e)
        {
            StringBuilder text = new StringBuilder();

            text.AppendLine("[基本参数]");
            text.AppendLine("中间件名称:【" + WcfServerManage.HostName + "】");
            text.AppendLine("中间件唯一标识:【" + WcfServerManage.Identify + "】");
            text.AppendLine("调试信息:\t\t" + (WcfServerManage.IsDebug ? "开启" : "关闭"));

            text.AppendLine("基础服务:\t\t" + (HostSettingConfig.GetValue("wcfservice") == "1" ? "开启" : "关闭"));
            text.AppendLine("文件传输:\t\t" + (HostSettingConfig.GetValue("filetransfer") == "1" ? "开启" : "关闭"));
            text.AppendLine("路由服务:\t\t" + (HostSettingConfig.GetValue("router") == "1" ? "开启" : "关闭"));
            text.AppendLine("WebAPI服务:\t\t" + (HostSettingConfig.GetValue("webapi") == "1" ? "开启" : "关闭"));

            text.AppendLine("心跳检测:\t\t" + (WcfServerManage.IsHeartbeat ? "开启" : "关闭") + "\t" + "间隔时间(秒):\t" + WcfServerManage.HeartbeatTime.ToString());
            text.AppendLine("消息发送:\t\t" + (WcfServerManage.IsMessage ? "开启" : "关闭") + "\t" + "间隔时间(秒):\t" + WcfServerManage.MessageTime.ToString());
            text.AppendLine("耗时日志记录:\t\t" + (WcfServerManage.IsOverTime ? "开启" : "关闭") + "\t" + "超过时间(秒):\t" + WcfServerManage.OverTime.ToString());

            text.AppendLine("数据压缩:\t\t" + (WcfServerManage.IsCompressJson ? "开启" : "关闭"));
            text.AppendLine("数据加密:\t\t" + (WcfServerManage.IsEncryptionJson ? "开启" : "关闭"));

            text.AppendLine();
            text.AppendLine("[发布服务地址]");
            if (HostSettingConfig.GetValue("wcfservice") == "1")
            {
                text.AppendLine("基础数据服务:" + HostAddressConfig.GetWcfAddress());
            }
            if (HostSettingConfig.GetValue("filetransfer") == "1")
            {
                text.AppendLine("文件传输服务:" + HostAddressConfig.GetFileAddress());
            }
            if (HostSettingConfig.GetValue("router") == "1")
            {
                text.AppendLine("路由基础服务:" + HostAddressConfig.GetRouterAddress());
                text.AppendLine("路由文件服务:" + HostAddressConfig.GetfileRouterAddress());
            }
            if (HostSettingConfig.GetValue("webapi") == "1")
            {
                text.AppendLine("WebAPI服务:" + HostAddressConfig.GetWebapiAddress());
            }

            text.AppendLine();
            text.AppendLine("[数据库连接]");
            text.AppendLine(HostDataBaseConfig.GetConnString());

            text.AppendLine();
            text.AppendLine("[通讯连接]");
            text.AppendLine("业务请求地址:" + HostAddressConfig.GetClientWcfAddress());
            text.AppendLine("文件传输地址:" + HostAddressConfig.GetClientFileAddress());

            text.AppendLine();
            text.AppendLine("[本地插件]");
            foreach (var p in AppPluginManage.PluginDic)
            {
                text.AppendLine(p.Key + "\t" + p.Value.plugin.title + "@" + p.Value.plugin.version);
            }

            text.AppendLine();
            text.AppendLine("[远程插件]");
            foreach (var p in EFWCoreLib.WcfFrame.ServerController.WcfServerManage.RemotePluginDic)
            {
                text.AppendLine(p.ServerIdentify + "\t" + String.Join(",", p.plugin));
            }

            text.AppendLine();
            text.AppendLine("[路由表]");
            text.AppendLine(HostRouterXml.GetXml());

            txtInfo.Text = text.ToString();
        }