/// <summary> /// 开通支付宝 /// </summary> /// <param name="phoneNum"></param> /// <param name="serverid"></param> /// <returns></returns> private bool GetPhone(ref string phoneNum, SmsServer serverid) { bool isok = false; for (int i = 0; i < 5; i++) { if (ConfigHelper.GetBoolValue("tbModelTest")) { phoneNum = GlobalVar.phoneNum; phoneNum = GlobalVar.sms.GetPhone(phoneNum, serverid); // SmsApi.GetPhone(serverid); } else { phoneNum = GlobalVar.sms.GetPhone(serverid); // SmsApi.GetPhone(serverid); } if (string.IsNullOrEmpty(phoneNum) || phoneNum == "未获取到号码") { LogManager.WriteLog("未获取到号码,等待5秒钟"); Thread.Sleep(5000); } else { isok = true; break; } } return(isok); }
/// <summary> /// 添加用户信息到缓存 /// </summary> /// <param name="objUser"></param> public static void AddCacheUser(SmsServer.Model.SmsUser objUser) { lock (pUserList) { pUserList[objUser.UserID+objUser.UserPwd] = objUser; } }
public string GetPhone(SmsServer smstype) { GetMobilenumResp resp = instance .getMobilenum(int.Parse(ConvertServerId2(smstype)), uid, logonresp.Token); // 取到一个号码 if (resp.State) { LogManager.WriteLog("获取到一个手机号码:" + resp.Mobile); return(resp.Mobile); } else { LogManager.WriteLog("未获取到 号码 " + resp.Result.ToString()); if ("message|速度过快,请稍后再试".Equals(resp.Result) || "message|please try again later".Equals(resp .Result)) { Thread.Sleep(1000); } else if ("max_count_disable".Equals(resp.Result)) { Thread.Sleep(2000); } } return(""); }
/// <summary> /// 判断映射名称或映射编号是否已经存在 /// </summary> public bool ExistsExEx(SmsServer.Model.MapScript model) { int iRowCount = MyDataBase.db.Select(SmsPlatForm.MapScript) .Where(SmsPlatForm.MapScript.MapID == model.MapID || SmsPlatForm.MapScript.MapName == model.MapName).ToDataSet().Tables[0].Rows.Count; return iRowCount > 0 ? true : false; }
/// <summary> /// 添加映射脚本到缓存 /// </summary> /// <param name="objScript"></param> public static void AddCacheMapScript(SmsServer.Model.MapScript objScript) { lock (pMapScriptList) { pMapScriptList[objScript.MapID] = objScript; } }
public votecountsFrm() { InitializeComponent(); this.comm = null; this.registerMessageReceived = false; this.smsServer = null; this.remotingSecurity = new SecuritySettings(); }
private void DestroySmsServer() { if (smsServer != null) { if (smsServer.IsRunning()) { smsServer.Stop(); } // Unregister events smsServer = null; } }
public string ConvertServerId2(SmsServer smstype) { if (smstype == SmsServer.zfb_reg_vcode) { return("1365"); } else if (smstype == SmsServer.tb_reg_vode) { return("2"); } else { return(""); } }
/// <summary> /// ����һ������ /// </summary> public bool Add(SmsServer.Model.SmsSpgate model) { try { MyDataBase.db.Insert(SmsPlatForm.SmsSpgate) .AddColumn(SmsPlatForm.SmsSpgate.GateNumber, model.GateNumber) .AddColumn(SmsPlatForm.SmsSpgate.GateName, model.GateName) .AddColumn(SmsPlatForm.SmsSpgate.GateType, model.GateType) .AddColumn(SmsPlatForm.SmsSpgate.BusinessID, model.BusinessID) .AddColumn(SmsPlatForm.SmsSpgate.IsLong, model.IsLong) .AddColumn(SmsPlatForm.SmsSpgate.IsSubport, model.IsSubport) .AddColumn(SmsPlatForm.SmsSpgate.IsSurportMo, model.IsSurportMo) .AddColumn(SmsPlatForm.SmsSpgate.IsReport, model.IsReport) .AddColumn(SmsPlatForm.SmsSpgate.MsgLen, model.MsgLen) .AddColumn(SmsPlatForm.SmsSpgate.MaxPhoneNum, model.MaxPhoneNum) .AddColumn(SmsPlatForm.SmsSpgate.MobileLen, model.MobileLen) .AddColumn(SmsPlatForm.SmsSpgate.UnicomLen, model.UnicomLen) .AddColumn(SmsPlatForm.SmsSpgate.TeleComLen, model.TeleComLen) .AddColumn(SmsPlatForm.SmsSpgate.ChinaPhoneLen, model.ChinaPhoneLen) .AddColumn(SmsPlatForm.SmsSpgate.GateInfo, model.GateInfo) .AddColumn(SmsPlatForm.SmsSpgate.PortUrl, model.PortUrl) .AddColumn(SmsPlatForm.SmsSpgate.MoUrl, model.MoUrl) .AddColumn(SmsPlatForm.SmsSpgate.ReportUrl, model.ReportUrl) .AddColumn(SmsPlatForm.SmsSpgate.UseridParamString, model.UseridParamString) .AddColumn(SmsPlatForm.SmsSpgate.PwdParamString, model.PwdParamString) .AddColumn(SmsPlatForm.SmsSpgate.MobileParamString, model.MobileParamString) .AddColumn(SmsPlatForm.SmsSpgate.MsgParamString, model.MsgParamString) .AddColumn(SmsPlatForm.SmsSpgate.SubportParamString, model.SubportParamString) .AddColumn(SmsPlatForm.SmsSpgate.GateNoParamString, model.GateNoParamString) .AddColumn(SmsPlatForm.SmsSpgate.PhoneNumParamString, model.PhoneNumParamString) .AddColumn(SmsPlatForm.SmsSpgate.UserID, model.UserID) .AddColumn(SmsPlatForm.SmsSpgate.UserPwd, model.UserPwd) .AddColumn(SmsPlatForm.SmsSpgate.SendParams, model.SendParams) .AddColumn(SmsPlatForm.SmsSpgate.SendType, model.SendType) .AddColumn(SmsPlatForm.SmsSpgate.EncodeType, model.EncodeType) .AddColumn(SmsPlatForm.SmsSpgate.TimeOut, model.TimeOut) .AddColumn(SmsPlatForm.SmsSpgate.MtScriptID, model.MtScriptID) .AddColumn(SmsPlatForm.SmsSpgate.MoScriptID, model.MoScriptID) .AddColumn(SmsPlatForm.SmsSpgate.ReportScriptID, model.ReportScriptID) .AddColumn(SmsPlatForm.SmsSpgate.IsWebService, model.IsWebService).Execute(); return true; } catch (System.Exception e) { } return false; }
public void AddLog(SmsServer.Model.sysLog model) { try { MyDataBase.db.Insert(SmsPlatForm.sysLog) .AddColumn(SmsPlatForm.sysLog.log_type, model.log_type) .AddColumn(SmsPlatForm.sysLog.log_detail, model.log_detail) .AddColumn(SmsPlatForm.sysLog.log_time, model.log_time) .AddColumn(SmsPlatForm.sysLog.operatorID, model.operatorID) .AddColumn(SmsPlatForm.sysLog.op_module, model.op_module).Execute(); } catch { } }
public string ConvertServerId2(SmsServer smstype) { if (smstype == SmsServer.zfb_reg_vcode) { return("1245"); } else if (smstype == SmsServer.tb_reg_vode) { return("27"); } else if (smstype == SmsServer.tb_reg_login_vcode) { return("863"); } return(""); }
public string getVcodeAndHoldMobilenum(SmsServer smstype, string phone, string nextpid) { GetVcodeAndReleaseMobileResp GetVRresp = new GetVcodeAndReleaseMobileResp(); String result = ""; try { result = send.HttpPost(url, "action=getVcodeAndHoldMobilenum&uid=" + uid + "&token=" + logonresp.Token + "&mobile=" + phone + "&author_uid=" + author_uid + "&next_pid=" + nextpid); String[] reset = result.Split('|'); if (reset.Length >= 2 && isNumber(reset[0])) { GetVRresp.State = true; GetVRresp.Mobile = reset[0]; GetVRresp.VerifyCode = reset[1]; GetVRresp.Result = result; } else { GetVRresp.State = false; GetVRresp.Result = result; } } catch (Exception e1) { LogManager.WriteLog(e1.ToString()); } if (GetVRresp.State) //获取到验证码,跳出 { return(GetVRresp.VerifyCode); // break; } else { LogManager.WriteLog(GetVRresp.Result); } return(""); }
/// <summary> /// 用于tbv3·模式1 /// </summary> /// <param name="phoneNum"></param> /// <returns></returns> public static bool GetPhone(ref string phoneNum, SmsServer ssServer) { bool isok = false; int waitPhoneTime = int.Parse(ConfigHelper.GetValue("waitPhoneTime")); for (int i = 0; i < 5; i++) { phoneNum = GlobalVar.sms.getOneSpecialMobilenum(ssServer, phoneNum);// SmsApi.GetPhone("2"); if (string.IsNullOrEmpty(phoneNum) || phoneNum == "未获取到号码") { LogManager.WriteLog("未获取到号码,等待{0}秒钟".With(waitPhoneTime)); Thread.Sleep(waitPhoneTime * 1000); } else { isok = true; break; } } return(isok); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(SmsServer.Model.MapScript model) { try { MyDataBase.db.Insert(SmsPlatForm.MapScript) .AddColumn(SmsPlatForm.MapScript.MapID, model.MapID) .AddColumn(SmsPlatForm.MapScript.MapName, model.MapName) .AddColumn(SmsPlatForm.MapScript.ScriptFlag, model.ScriptFlag) .AddColumn(SmsPlatForm.MapScript.ScriptType, model.ScriptType) .AddColumn(SmsPlatForm.MapScript.ScriptCode, model.ScriptCode) .AddColumn(SmsPlatForm.MapScript.EasyScriptCode, "") .AddColumn(SmsPlatForm.MapScript.MoSpgate, model.MoSpgate) .AddColumn(SmsPlatForm.MapScript.MapInfo, model.MapInfo).Execute(); return true; } catch (System.Exception e) { } return false; }
/// <summary> /// ����һ������ /// </summary> public bool Add(SmsServer.Model.SmsTaskA model) { //return 0; try { MyDataBase.db.Insert(SmsPlatForm.SmsTaskA) .AddColumn(SmsPlatForm.SmsTaskA.PhoneList, model.PhoneList) .AddColumn(SmsPlatForm.SmsTaskA.MsgContent, model.MsgContent) .AddColumn(SmsPlatForm.SmsTaskA.SubTime, model.SubTime) .AddColumn(SmsPlatForm.SmsTaskA.SendTime, model.SendTime) .AddColumn(SmsPlatForm.SmsTaskA.UserID, model.UserID) .AddColumn(SmsPlatForm.SmsTaskA.ParentID, model.ParentID) .AddColumn(SmsPlatForm.SmsTaskA.SpgateNo, model.SpgateNo) .AddColumn(SmsPlatForm.SmsTaskA.SubPort, model.SubPort) .AddColumn(SmsPlatForm.SmsTaskA.SubPortEx, model.SubPortEx) .AddColumn(SmsPlatForm.SmsTaskA.FeeNum, model.FeeNum) .AddColumn(SmsPlatForm.SmsTaskA.PhoneNum, model.PhoneNum) .AddColumn(SmsPlatForm.SmsTaskA.MsgLen, model.MsgLen) .AddColumn(SmsPlatForm.SmsTaskA.HasIndex, model.HasIndex) .AddColumn(SmsPlatForm.SmsTaskA.SendType, model.SendType) .AddColumn(SmsPlatForm.SmsTaskA.SendFlag, model.SendFlag) .AddColumn(SmsPlatForm.SmsTaskA.SaveType, model.SaveType) .AddColumn(SmsPlatForm.SmsTaskA.MobileNum, model.MobileNum) .AddColumn(SmsPlatForm.SmsTaskA.UnicomNum, model.UnicomNum) .AddColumn(SmsPlatForm.SmsTaskA.TelecomNum, model.TelecomNum) .AddColumn(SmsPlatForm.SmsTaskA.ChinaNum, model.ChinaNum) .AddColumn(SmsPlatForm.SmsTaskA.SingleMobileFee, model.SingleMobileFee) .AddColumn(SmsPlatForm.SmsTaskA.SingleUnicomFee, model.SingleUnicomFee) .AddColumn(SmsPlatForm.SmsTaskA.SingleTelecomFee, model.SingleTelecomFee) .AddColumn(SmsPlatForm.SmsTaskA.SingleChinaFee, model.SingleChinaFee).Execute(); return true; } catch (System.Exception e) { throw new Exception(e.Message); // return false; } }
/// <summary> /// ����һ������ /// </summary> public bool Add(SmsServer.Model.SmsUser model) { MyDataBase.db.Insert(SmsPlatForm.SmsUser) .AddColumn(SmsPlatForm.SmsUser.UserID, model.UserID) .AddColumn(SmsPlatForm.SmsUser.UserPwd, model.UserPwd) .AddColumn(SmsPlatForm.SmsUser.ParentID, model.ParentID) .AddColumn(SmsPlatForm.SmsUser.UserClass, model.UserClass) .AddColumn(SmsPlatForm.SmsUser.Status, model.Status) .AddColumn(SmsPlatForm.SmsUser.DisabledBy, model.DisabledBy) .AddColumn(SmsPlatForm.SmsUser.SendedNum, model.SendedNum) .AddColumn(SmsPlatForm.SmsUser.Balance, model.Balance) .AddColumn(SmsPlatForm.SmsUser.MaxCount, model.MaxCount) .AddColumn(SmsPlatForm.SmsUser.MinCount, model.MinCount) .AddColumn(SmsPlatForm.SmsUser.AuditNum, model.AuditNum) .AddColumn(SmsPlatForm.SmsUser.IsAudit, model.IsAudit) .AddColumn(SmsPlatForm.SmsUser.MaxLen, model.MaxLen) .AddColumn(SmsPlatForm.SmsUser.MobileLen, model.MobileLen) .AddColumn(SmsPlatForm.SmsUser.UnicomLen, model.UnicomLen) .AddColumn(SmsPlatForm.SmsUser.TelecomLen, model.TelecomLen) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneLen, model.ChinaPhoneLen) .AddColumn(SmsPlatForm.SmsUser.SignStr, model.SignStr) .AddColumn(SmsPlatForm.SmsUser.HasIndex, model.HasIndex) .AddColumn(SmsPlatForm.SmsUser.MobileSpgate, model.MobileSpgate) .AddColumn(SmsPlatForm.SmsUser.UnicomSpgate, model.UnicomSpgate) .AddColumn(SmsPlatForm.SmsUser.TelecomSpgate, model.TelecomSpgate) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneSpgate, model.ChinaPhoneSpgate) .AddColumn(SmsPlatForm.SmsUser.UnicomMap, model.UnicomMap) .AddColumn(SmsPlatForm.SmsUser.TelecomMap, model.TelecomMap) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneMap, model.ChinaPhoneMap) .AddColumn(SmsPlatForm.SmsUser.HistoryType, model.HistoryType) .AddColumn(SmsPlatForm.SmsUser.CreatTime, model.CreatTime) .AddColumn(SmsPlatForm.SmsUser.UserName, model.UserName) .AddColumn(SmsPlatForm.SmsUser.CompanyName, model.CompanyName) .AddColumn(SmsPlatForm.SmsUser.Phone, model.Phone) .AddColumn(SmsPlatForm.SmsUser.ExtraInfo, model.ExtraInfo).Execute(); return true; }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsReceived model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(SmsServer.Model.SmsReceived model) { dal.Update(model); }
/// <summary> /// ����ͨ���IJ����ַ��� /// </summary> /// <param name="model"></param> private void UpdateSendParams(SmsServer.Model.SmsSpgate model) { StringBuilder objBuilder = new StringBuilder(); objBuilder.Append(model.UseridParamString + "=" + model.UserID + "&"); objBuilder.Append(model.PwdParamString + "=" + model.UserPwd + "&"); objBuilder.Append(model.MobileParamString + "={0}&"); objBuilder.Append(model.MsgParamString + "={1}&"); objBuilder.Append(model.PhoneNumParamString + "={2}&"); objBuilder.Append(model.SubportParamString + "={3}&"); objBuilder.Append(model.GateNoParamString + "={4}"); model.SendParams = objBuilder.ToString(); // model.UseridParamString = ""; // model.PwdParamString = ""; // model.UserID = ""; // model.UserPwd = ""; }
/// <summary> /// ����һ������ /// </summary> public void Update(SmsServer.Model.SmsTaskA model) { }
public void ReleasePhone(string phone, SmsServer smstype) { var res = instance.addIgnoreList(int.Parse(ConvertServerId2(smstype)), phone, uid, logonresp.Token); LogManager.WriteLog(res.Result); }
private void TestTest(ref SmsServer.Model.SmsSpgate model) { //model = new SmsServer.BLL.SmsSpgate().GetModelByCache("106570003"); }
/// <summary> /// ����һ������ /// </summary> public bool Update(SmsServer.Model.SmsUser model) { try { MyDataBase.db.Update(SmsPlatForm.SmsUser) .AddColumn(SmsPlatForm.SmsUser.Status, model.Status) .AddColumn(SmsPlatForm.SmsUser.MaxCount, model.MaxCount) .AddColumn(SmsPlatForm.SmsUser.MinCount, model.MinCount) .AddColumn(SmsPlatForm.SmsUser.AuditNum, model.AuditNum) .AddColumn(SmsPlatForm.SmsUser.IsAudit, model.IsAudit) .AddColumn(SmsPlatForm.SmsUser.MaxLen, model.MaxLen) .AddColumn(SmsPlatForm.SmsUser.MobileLen, model.MobileLen) .AddColumn(SmsPlatForm.SmsUser.UnicomLen, model.UnicomLen) .AddColumn(SmsPlatForm.SmsUser.TelecomLen, model.TelecomLen) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneLen, model.ChinaPhoneLen) .AddColumn(SmsPlatForm.SmsUser.SignStr, model.SignStr) .AddColumn(SmsPlatForm.SmsUser.HasIndex, model.HasIndex) .AddColumn(SmsPlatForm.SmsUser.MobileSpgate, model.MobileSpgate) .AddColumn(SmsPlatForm.SmsUser.UnicomSpgate, model.UnicomSpgate) .AddColumn(SmsPlatForm.SmsUser.TelecomSpgate, model.TelecomSpgate) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneSpgate, model.ChinaPhoneSpgate) .AddColumn(SmsPlatForm.SmsUser.MobileMap, model.MobileMap) .AddColumn(SmsPlatForm.SmsUser.UnicomMap, model.UnicomMap) .AddColumn(SmsPlatForm.SmsUser.TelecomMap, model.TelecomMap) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneMap, model.ChinaPhoneMap) .AddColumn(SmsPlatForm.SmsUser.MobileSubport, model.MobileSubport) .AddColumn(SmsPlatForm.SmsUser.UnicomSubport, model.UnicomSubport) .AddColumn(SmsPlatForm.SmsUser.TelecomSubport, model.TelecomSubport) .AddColumn(SmsPlatForm.SmsUser.ChinaPhoneSubport, model.ChinaPhoneSubport) .AddColumn(SmsPlatForm.SmsUser.HistoryType, model.HistoryType) .AddColumn(SmsPlatForm.SmsUser.UserName, model.UserName) .AddColumn(SmsPlatForm.SmsUser.CompanyName, model.CompanyName) .AddColumn(SmsPlatForm.SmsUser.Phone, model.Phone) .AddColumn(SmsPlatForm.SmsUser.IsSpgateFee, model.IsSpgateFee) .AddColumn(SmsPlatForm.SmsUser.ExtraInfo, model.ExtraInfo) .Where(SmsPlatForm.SmsUser.UserID == model.UserID).Execute(); return true; } catch (Exception ee) { return false; } }
public string GetMessage(SmsServer smstype, string phone) { return(SmsApi.GetMessage(ConvertServerId2(smstype), phone));// GetPhone(ConvertServerId2(smstype)) }
private void TestTestEx(SmsServer.Model.SmsSpgate model) { model.GateNumber = "AAAAAAAAAA"; }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsOprateLog model) { return 0; }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsRetValue model) { return 0; }
/// <summary> /// �ж�ͨ�����ƻ�ͨ�����Ƿ��Ѿ����� /// </summary> public bool ExistsExEx(SmsServer.Model.SmsSpgate model) { int iRowCount = MyDataBase.db.Select(SmsPlatForm.SmsSpgate) .Where(SmsPlatForm.SmsSpgate.GateNumber == model.GateNumber || SmsPlatForm.SmsSpgate.GateName == model.GateName).ToDataSet().Tables[0].Rows.Count; return iRowCount > 0 ? true : false; }
/// <summary> /// ����һ������ /// </summary> public bool Add(SmsServer.Model.SmsTaskA model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsReceived model) { return 0; }
/// <summary> /// ����һ������ /// </summary> public void Update(SmsServer.Model.SmsTaskB model) { dal.Update(model); }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsTaskB model) { return dal.Add(model); }
public void ReleasePhone(string phone, SmsServer smstype) { SmsApi.ReleasePhone(phone, ConvertServerId2(smstype)); }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsTaskB model) { return 0; }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsLoginLog model) { return 0; }
/// <summary> /// ����һ������ /// </summary> public void Update(SmsServer.Model.SmsRetValue model) { dal.Update(model); }
public string getOneSpecialMobilenum(SmsServer smstype, string mobile) { throw new NotImplementedException(); }
/// <summary> /// ����һ������ /// </summary> public void Update(SmsServer.Model.SmsLoginLog model) { }
public string GetPhone(string phone, SmsServer smstype) { throw new NotImplementedException(); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(SmsServer.Model.MapScript model) { try { MyDataBase.db.Update(SmsPlatForm.MapScript) .AddColumn(SmsPlatForm.MapScript.MapName, model.MapName) .AddColumn(SmsPlatForm.MapScript.ScriptFlag, model.ScriptFlag) .AddColumn(SmsPlatForm.MapScript.ScriptType, model.ScriptType) .AddColumn(SmsPlatForm.MapScript.ScriptCode, model.ScriptCode) .AddColumn(SmsPlatForm.MapScript.MoSpgate, model.MoSpgate) .AddColumn(SmsPlatForm.MapScript.MapInfo, model.MapInfo) .Where(SmsPlatForm.MapScript.MapID == model.MapID).Execute(); return true; } catch (System.Exception e) { //记录日志 return false; } }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsRetValue model) { return dal.Add(model); }
public string getVcodeAndHoldMobilenum(SmsServer smstype, string phone, string nextpid) { throw new NotImplementedException(); }
/// <summary> /// ����һ������ /// </summary> public int Add(SmsServer.Model.SmsOprateLog model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(SmsServer.Model.SmsOprateLog model) { }
public string GetPhone(SmsServer smstype) { return(SmsApi.GetPhone(ConvertServerId2(smstype))); }