Example #1
0
 public void AddOrUpdateToken(AuthToken Token)
 {
     CertCacheItem t_tokenitem = null;
     Token.lastauth = DateTime.Now;//上次请求certcennt的时间。
     t_tokenitem = tempmanagecache.FirstOrDefault(x => x.Token.token == Token.token);
     if (t_tokenitem == null)
         tempmanagecache.Add(new CertCacheItem() { Token = Token });
     else
     {
         t_tokenitem.Token = Token;
     }
     SetCertCahe();
 }
Example #2
0
 /// <summary>
 /// close this obj to another instance
 /// </summary>
 /// <returns></returns>
 public object Clone()
 {
     AuthToken obj = new AuthToken()
     {
         appid = this.appid,
         createtime = this.createtime,
         expires = this.expires,
         lastauth = this.lastauth,
         token = this.token,
         userid = this.userid,
         username = this.username,
         id = this.id
     };
     return obj;
 }