Authed.io检查用户是否已过期| VB |

时间:2018-06-17 14:31:58

标签: vb.net

我希望项目检查帐户的期限是否结束,因为它记录了每个帐户,即使帐户的期限结束但我也不知道这里有什么问题

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

1 个答案:

答案 0 :(得分:1)

有1个不同的选项来确定用户是否过期。

auth.user.expires可以为您提供帐户到期的确切日期。现在,您可以致电DateTime.Now并检查auth.user.expires中给定的日期是否过去,并通知用户该日期已过期。

相关问题