Password Generator dengan visual basic

Cara pembuatan Password Generator dengan Visual Basic mungkin sudah ada diantara kalian yang udah tau gimana cara ngebuatnya,untuk membuat komponen yang di butuhin semacam :
1 Form,
2 Option Button :
Captionnya -> 8 Karakter dan 16 karakter
2 Label :
Captionnya -> Site dan password
2 Text Box :
Captionnya dan namenya -> Terserah
2 Command Button :
Captionnya -> Cari Password dan Simpan ke File
Buat tampilannya seperti gambar ini :

Image

Terus tinggal masukin aja Coding dibawah ini ke Formnya :

Code:

Private Sub Command1_Click()
Dim x As Integer
If Option1.Value = False And Option2.Value = False Then MsgBox “Pilih Option Karakter Passwordnya!”, vbCritical: Exit Sub
If Option1.Value = True Then x = 8
If Option2.Value = True Then x = 16
Text2 = Gen_Rand_Password(x)
End Sub
Private Sub Command2_Click()
Dim saveinfo As String
saveinfo = “Password Generator By Shadow Angel” & vbCrLf & “Password Generated Shadow Angel ” & Date _
& vbCrLf & “Site: ” & Text1 & ” Password: ” & Text2 & vbCrLf
fnum = FreeFile
Open App.Path & “\password.rtf” For Append As fnum
Write #fnum, saveinfo
Close fnum
End Sub
Public Function Gen_Rand_Password(PassLength As Integer) As String
On Error Resume Next
Dim RetVal As String
Dim i As Integer
Dim Max As Integer
Dim Min As Integer
Max = 126
Min = 48
Randomize Timer
For i = 1 To PassLength
RetVal = RetVal & Chr(Int((Max – Min + 1) * Rnd + Min))
Next i
Gen_Rand_Password = RetVal
End Function

Image

Tinggalkan komentar

Belum ada komentar.

Comments RSS TrackBack Identifier URI

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s