private void btnOk_Click(object sender, EventArgs e) { TimeCDKEY.WriteSetting(txtCode.Text); string expireDate; string identify; int res = TimeCDKEY.InitRegedit(out expireDate, out identify); if (res == 0) { MessageBox.Show("激活成功,到期时间【" + expireDate + "】,请重新启动软件!"); this.Close(); } else if (res == 1) { MessageBox.Show("软件尚未注册,请注册软件!"); } else if (res == 2) { MessageBox.Show("注册机器与本机不一致,请联系管理员!"); } else if (res == 3) { MessageBox.Show("软件试用已到期!"); } else { MessageBox.Show("软件运行出错,请重新启动!"); } }
private void btnStart_Click(object sender, EventArgs e) { timermsg.Start(); MiddlewareLogHelper.hostwcfMsg = new MiddlewareMsgHandler(AddMsg); MiddlewareLogHelper.StartWriteFileLog();//开放中间件日志 int res = TimeCDKEY.InitRegedit(out expireDate, out identify); if (res == 0) { MiddlewareLogHelper.WriterLog(LogType.MidLog, true, Color.Green, "软件已注册,到期时间【" + expireDate + "】"); StartAllHost(); } else if (res == 1) { MiddlewareLogHelper.WriterLog(LogType.MidLog, true, Color.Red, "软件尚未注册,请注册软件"); } else if (res == 2) { MiddlewareLogHelper.WriterLog(LogType.MidLog, true, Color.Red, "注册机器与本机不一致,请联系管理员"); } else if (res == 3) { MiddlewareLogHelper.WriterLog(LogType.MidLog, true, Color.Red, "软件试用已到期"); } else { MiddlewareLogHelper.WriterLog(LogType.MidLog, true, Color.Red, "软件运行出错,请重新启动"); } }
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") + "] : " + "软件运行出错,请重新启动!"); } }
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, "软件运行出错,请重新启动!"); } }