Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.27 KB | None | 0 0
  1. Imports Telerik.WinControls
  2. Imports Telerik.WinControls.UI
  3. Imports System.IO
  4.  
  5. Public Class Form2
  6.  
  7.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  8.         ThemeResolutionService.ApplicationThemeName = "Office2010Blue"
  9.     End Sub
  10.  
  11.     Private Sub Buttonregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buttonsignin.Click
  12.         If (TextBoxpassword.Text = Nothing Or TextBoxusername.Text = Nothing) Then
  13.             RadMessageBox.Show("All fields should be filled with proper information")
  14.         Else
  15.  
  16.             Using reader As StreamReader = New StreamReader(My.Application.Info.DirectoryPath + "\" + TextBoxusername.Text)
  17.                 While Not reader.EndOfStream
  18.                     Dim username As String = reader.ReadLine()
  19.                     Dim password As String = reader.ReadLine()
  20.  
  21.                     If username = TextBoxusername.Text And password = TextBoxpassword.Text Then
  22.                         RadMessageBox.Show("You have sucesfully signed in")
  23.                     Else
  24.                         RadMessageBox.Show("Invalid username or password")
  25.                     End If
  26.                 End While
  27.             End Using
  28.         End If
  29.     End Sub
  30. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement