统一登录注册时限制发送验证码次数功能的解决方法

  

当我们需要在统一客户端做一个限制功能,比如按钮(最好是发送验证码按钮)要求每天只能点击三次,等到第二天又有三次机会,这个过程不涉及到服务端消息,只涉及到本地存储,以下是我的解决方案:

  

直接上代码:

        使用System.Collections;   使用System.Collections.Generic;   使用UnityEngine;   使用UnityEngine.UI;   使用UniRx;   使用系统;   使用先;   使用text;   使用System.Globalization;   公开课RegisterPanel: MonoBehaviour   {   私人LoginUIPanel mLoginUIPanel;   StreamWriter作家;   StreamReader读者;//本地存储手机号   私人字符串set_phonenum;//同一个手机号码使用次数   私人int useNum=1;   FileInfo文件;   私人按钮btn_GetMsgCode;/* *倒计时*/私人文本txt_CountDownTimer;         }   私人空间清醒()   {//获取验证码按钮   btn_GetMsgCode=input_MsgCode.transform.Find (“Btn_GetVerficationCode”) .GetComponent