需要限制一下;在一个帐户里一段时间只能验证一次手机短信。那位朋友能帮助解决一下,感激不尽(虽然没有积分,有热心的朋友留下个邮箱,我送点别的,表示一点感激心情。
这是下面的部分代码:        string circle = e_WebConfig.SMSPlatform_Name;
        string pwd = e_WebConfig.SMSPlatform_Pwd;
        string message = "您的体验码:[" + ExperienceCode.ToString() + "]。";
        string url = "http://txt1.alexcomm.com/CXAPI/smExSendMassMsgNew.asp?user=" + circle + "&password=" + pwd + "&fromMobile=FROMNUMBER&toMobile=" + mobile + "&msg=" + message;
        string[] Experience = { mobile, ExperienceCode.ToString() };        if (l_user.SendExperienceCode(url))
        {
            Session.Add("Experience", Experience);
            txtExperience.Enabled = true;
            btnExperience.Enabled = true;
            Response.Write("<script type=\"text/javascript\">alert('一条验证码已经发送到您的手机,请注意查收。')</script>");
        }
        else
        {
            Response.Write("<script type=\"text/javascript\">alert('发送体验码失败,请联系管理员。')</script>");
        }

解决方案 »

  1.   

    还是自己解决了。
    1、在数据库建立一个发送短信成功后的时间字段(VTime)。初始为空(null) 数据类型为:DateTime。
    2、当短信发送成功后返回一个发送时间存储到(User表的VTime字段里)。
    3、当再一次发送验证码时从VTime里的时间与当前时间进行比对,
       如果小于4小时则不能发送,
       当大于4小时则可以进行发送,且再次Update当前成功发送的时间。