public void ThreadPort5200() { while (true) { bool res = false; //检测后台端口,充值端口5200 try { GL.ProtocolBack.Bind tbind = MWeb.protobuf.SCmd.Cmd.runClient(new GL.ProtocolBack.Bind(ProtoCmd.Service.ServiceCmd.SC_SELECT_REDEVENLOPE_Q, new byte[0] { })); switch ((ProtoCmd.Service.CenterCmd)tbind.header.CommandID) { case ProtoCmd.Service.CenterCmd.CS_SELECT_REDEVENLOPE_P: res = true; break; case ProtoCmd.Service.CenterCmd.CS_CONNECT_ERROR: res = false; break; } } catch { res = false; } if (!res)//报警 充值端口5500 { TimerBLL.AddTMonitorLog(26); } Thread.Sleep(TMonitorSingle.ExecType * 60 * 1000); } }
public void ThreadProc() { while (true) { string execSql = ""; //这里就是要执行的任务,本处只显示一下传入的参数 foreach (var item in TMonitorDatas) { //SafeBoxSet SUpdate times = TimerBLL.GetTimeForGame(item.UpdateTable); string sql = item.ExecSQL.Replace("@StartDate", "'" + times.CountDate + "'") .Replace("@EndDate", "'" + times.id_date + "'"); //修改时间 sql = sql + "update record.S_Update set CountDate='" + times.id_date + "' , id_date=now() where UpdateTable='" + item.UpdateTable + "';"; execSql += sql; } int i = TimerBLL.ExecuteSql(execSql); Thread.Sleep(TMonitorDatas[0].ExecType * 60 * 1000); } }
public ActionResult DataControlLog() { try { int id = Convert.ToInt32(Request["id"]); int userid = Convert.ToInt32(Request["userid"]); int i = TimerBLL.AddTMonitorLog(id, userid); return(Content(i.ToString())); } catch { return(Content("0")); } }
public void ThreadPort5500() { while (true) { bool res = false; //检测后台端口,充值端口5500 try { ProtoCmd.BackRecharge.normal ServiceNormalS = ProtoCmd.BackRecharge.normal.CreateBuilder() .SetUserID((uint)0) .SetList("") .SetRmb(0) .SetRmbActual(0) .SetFirstGif(false) .SetBillNo("JK001") .Build(); Bind tbind = Cmd.runClient(new Bind(ProtoCmd.BackRecharge.BR_Cmd.BR_NORMAL, ServiceNormalS.ToByteArray())); switch ((CenterCmd)tbind.header.CommandID) { case CenterCmd.CS_NORMAL: res = true; break; case CenterCmd.CS_CONNECT_ERROR: res = false; break; } } catch { res = false; } if (!res)//报警 充值端口5500 { TimerBLL.AddTMonitorLog(25); } Thread.Sleep(TMonitorSingle.ExecType * 60 * 1000); } }