Advertisement
Guest User

Untitled

a guest
Jan 12th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. Imports Authed
  2. Imports Jose.jwe
  3. Public Class Login
  4.  
  5. 'Tutorial to use Authed.IO for VB
  6. 'Be sure you reference the dlls After adding the Authed.dll and Jose.jwe.dll
  7.  
  8. Dim auth As Auth = New Auth()
  9.  
  10. 'Add the AuthedChecker.vb to your project and use it
  11. Dim checker As AuthedChecker = New AuthedChecker()
  12.  
  13. Dim login As Boolean = auth.Login(Username, Password)
  14. Dim register As Boolean = auth.Register(Username, Password, Email, Token)
  15. Dim Username As String, Password As String, Email As String, Token As String
  16.  
  17. Private Sub Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  18. 'To use your application key simply grab it from the site and double click your form to create the FormOpening function
  19. If (checker.CheckFiles() = True) Then
  20. Dim appauth As Boolean = auth.Authenticate("vXiE5m9xs5Zgpp0LFKJrRljUgY24eO5EWtbs0G3uIUarc")
  21. If (appauth = False) Then
  22. MsgBox("Failed to connect to the server")
  23. End If
  24. Else
  25. MsgBox("Make sure you have required DLLs in your CerealGen directory")
  26. End If
  27. End Sub
  28.  
  29. Private Sub Button2_Click(sender As Object, e As EventArgs)
  30.  
  31. End Sub
  32.  
  33. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  34. If Button1.Text = "Login" Then
  35. Username = TextBox1.Text
  36. Password = TextBox2.Text
  37. If (login = True) Then
  38. Dim mydialogbox As New Form1
  39. Form1.ShowDialog()
  40. Close()
  41. Else
  42. MsgBox("Login failed")
  43. End If
  44. End If
  45.  
  46. If Button1.Text = "Register" Then
  47. Username = TextBox1.Text
  48. Password = TextBox2.Text
  49. Email = TextBox4.Text
  50. Token = TextBox3.Text
  51.  
  52. If (register = True) Then
  53. MsgBox("Successfully registered")
  54. Else
  55. MsgBox("Register Failed")
  56. End If
  57. End If
  58. End Sub
  59.  
  60. Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
  61. If Button1.Text = "Login" Then
  62. Button1.Text = "Register"
  63. ElseIf Button1.Text = "Register" Then
  64. Button1.Text = "Login"
  65. End If
  66.  
  67. If TextBox3.Visible = True Then
  68. TextBox3.Visible = False
  69. ElseIf TextBox3.Visible = False Then
  70. TextBox3.Visible = True
  71. End If
  72.  
  73. If Label5.Visible = True Then
  74. Label5.Visible = False
  75. ElseIf Label5.Visible = False Then
  76. Label5.Visible = True
  77. End If
  78.  
  79. If TextBox4.Visible = True Then
  80. TextBox4.Visible = False
  81. ElseIf TextBox4.Visible = False Then
  82. TextBox4.Visible = True
  83. End If
  84.  
  85. If Label4.Visible = True Then
  86. Label4.Visible = False
  87. ElseIf Label4.Visible = False Then
  88. Label4.Visible = True
  89. End If
  90. End Sub
  91. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement