我希望项目检查帐户的期限是否结束,因为它记录了每个帐户,即使帐户的期限结束但我也不知道这里有什么问题
Imports Authed
Imports Jose.jwe
Imports Newtonsoft
Public Class Form1
Dim auth As Auth = New Auth()
Dim appauth As Boolean = auth.Authenticate("*****************")
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
If (appauth = False) Then
MessageBox.Show("Failed Auth")
End If
End Sub
Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
Dim login As Boolean = auth.Login(txtLogin.Text, txtPass.Text)
If login = auth.user.expired Then
MessageBox.Show("Expired")
Close()
End If
If (login = True) Then
Me.Hide()
Form3.Show()
Else
MessageBox.Show("Failed")
End If
End Sub
答案 0 :(得分:1)
有1个不同的选项来确定用户是否过期。
有auth.user.expires
可以为您提供帐户到期的确切日期。现在,您可以致电DateTime.Now
并检查auth.user.expires
中给定的日期是否过去,并通知用户该日期已过期。