.NET 延时方法


using Common;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Web;
using System.Xml;

namespace Web

{

public class SecureValidation
{

private static DateTime GetAccessToken_Time;
/// <summary>
/// 过期时间
/// </summary>
private static int Expires_Period = 3;
/// <summary>
///
/// </summary>
private static string mAccessToken;

/// <summary>
/// 判断是否过期
/// </summary>
/// <returns>bool</returns>
private static bool HasExpired()
{

if (GetAccessToken_Time != null)

{

if (rlt != "true")

{

return true;

}
if (DateTime.Now > GetAccessToken_Time.AddHours(Expires_Period))
{

return true;

}

}

return false;

}

private static string rlt;

/// <summary>

/// 延时方法

/// </summary>

/// <returns></returns>

public static string LSA()

{

if (HasExpired())
{


if (//验证成功)
{

GetAccessToken_Time = DateTime.Now;

}
else
{


rlt = "%^&*(";

}

}

 

return rlt;

 

}

}

}

}

posted @ 2016-05-06 14:41  DinnisZhang  阅读(1283)  评论(0编辑  收藏  举报