Exemplo n.º 1
0
 private void refreshJSTickect()
 {
     if (!Status)
     {
         return;
     }
     LastRunDateTime = DateTime.Now;
     try
     {
         string newTickect = WeiXinJSAPI.GetTickect(_token).ticket;
         _jsTickect = newTickect;
         if (JSTickectChangedEvent != null)
         {
             JSTickectChangedEvent(this, EventArgs.Empty);
         }
     }
     catch (Exception ex)
     {
         if (ErrorEvent != null)
         {
             ErrorEvent(this, new ThreadExceptionEventArgs(ex));
         }
     }
 }
Exemplo n.º 2
0
 private void refreshToken()
 {
     if (!Status)
     {
         return;
     }
     LastRunDateTime = DateTime.Now;
     try
     {
         string newToken = WeiXinJSAPI.GetAccessToken(AppId, AppSecrect).access_token;
         _token = newToken;
         if (TokenChangedEvent != null)
         {
             TokenChangedEvent(this, EventArgs.Empty);
         }
     }
     catch (Exception ex)
     {
         if (ErrorEvent != null)
         {
             ErrorEvent(this, new ThreadExceptionEventArgs(ex));
         }
     }
 }