Welcome to Ethical Hackers
Nick:  
Pass:     
Register Help Member List View New Posts View Today's Posts

Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.Net] Offline Login System
07-06-2010, 06:55 AM
Post: #1
[VB.Net] Offline Login System
Hi all,

I'm going to show you how to make a 'Offline Login System'.
This is my first tutorial so please only give me constructive comments

Form2 :

Add 1 Button
Add 1 Label
Add 1 Textbox


Form2 :

Quote:Imports System.IO

Public Class Form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.FileSystem.WriteAllText("C:\Password.Txt", MD5(TextBox1.Text), False)
'This makes the file and write in it.
Form1.Show()
End Sub

Quote:Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Computer.FileSystem.FileExists("C:\Password.Txt") Then
'Checks if the file already exists
Form1.Show()
Form1.Focus()
End If
End Sub

Quote:Public Shared Function MD5(ByVal Text As String, Optional ByVal Seperator As String = Nothing) As String
Dim Hash As Byte()
Dim Encoder As New System.Text.UTF8Encoding()
Dim Hasher As New System.Security.Cryptography.MD5CryptoSe​rviceProvider()
Hash = Hasher.ComputeHash(Encoder.GetBytes(Text​))
Text = Replace(BitConverter.ToString(Hash), "-", Seperator)
Return Text
End Function
'MD5 Encryption
End Class

Now we are going to make a new form.

Project > Add > New item > Windows Form

Add 1 Button
Add 1 Label
Add 1 TextBox

Double-Click Button1 And add the following code :

Quote:
Quote:If My.Computer.FileSystem.ReadAllText("C:\Password.txt") = MD5(TextBox1.Text) Then
MsgBox("Password is correct")
Me.Close()
Form2.Close()
Else
MsgBox("Password is incorrect")
End If
End Sub

This will read the .txt file we maked and checks if it match the password.

Now add this code again :

Quote:Public Shared Function MD5(ByVal Text As String, Optional ByVal Seperator As String = Nothing) As String
Dim Hash As Byte()
Dim Encoder As New System.Text.UTF8Encoding()
Dim Hasher As New System.Security.Cryptography.MD5CryptoSe​rviceProvider()
Hash = Hasher.ComputeHash(Encoder.GetBytes(Text​))
Text = Replace(BitConverter.ToString(Hash), "-", Seperator)
Return Text
End Function


I hope this helped someone ;)
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Star [VB6] Login 88power88 6 645 06-13-2010 03:45 AM
Last Post: longnha

Forum Jump:


User(s) browsing this thread: 2 Guest(s)



Ethical Hackers © 2012.