Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Authed
- Imports Jose.jwe
- Public Class Login
- 'Tutorial to use Authed.IO for VB
- 'Be sure you reference the dlls After adding the Authed.dll and Jose.jwe.dll
- Dim auth As Auth = New Auth()
- 'Add the AuthedChecker.vb to your project and use it
- Dim checker As AuthedChecker = New AuthedChecker()
- Dim login As Boolean = auth.Login(Username, Password)
- Dim register As Boolean = auth.Register(Username, Password, Email, Token)
- Dim Username As String, Password As String, Email As String, Token As String
- Private Sub Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'To use your application key simply grab it from the site and double click your form to create the FormOpening function
- If (checker.CheckFiles() = True) Then
- Dim appauth As Boolean = auth.Authenticate("vXiE5m9xs5Zgpp0LFKJrRljUgY24eO5EWtbs0G3uIUarc")
- If (appauth = False) Then
- MsgBox("Failed to connect to the server")
- End If
- Else
- MsgBox("Make sure you have required DLLs in your CerealGen directory")
- End If
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- If Button1.Text = "Login" Then
- Username = TextBox1.Text
- Password = TextBox2.Text
- If (login = True) Then
- Dim mydialogbox As New Form1
- Form1.ShowDialog()
- Close()
- Else
- MsgBox("Login failed")
- End If
- End If
- If Button1.Text = "Register" Then
- Username = TextBox1.Text
- Password = TextBox2.Text
- Email = TextBox4.Text
- Token = TextBox3.Text
- If (register = True) Then
- MsgBox("Successfully registered")
- Else
- MsgBox("Register Failed")
- End If
- End If
- End Sub
- Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
- If Button1.Text = "Login" Then
- Button1.Text = "Register"
- ElseIf Button1.Text = "Register" Then
- Button1.Text = "Login"
- End If
- If TextBox3.Visible = True Then
- TextBox3.Visible = False
- ElseIf TextBox3.Visible = False Then
- TextBox3.Visible = True
- End If
- If Label5.Visible = True Then
- Label5.Visible = False
- ElseIf Label5.Visible = False Then
- Label5.Visible = True
- End If
- If TextBox4.Visible = True Then
- TextBox4.Visible = False
- ElseIf TextBox4.Visible = False Then
- TextBox4.Visible = True
- End If
- If Label4.Visible = True Then
- Label4.Visible = False
- ElseIf Label4.Visible = False Then
- Label4.Visible = True
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement