Včera som nemal vela času tak som to len tak na rychlo tu napisal. Tu je cely kod:
Kod formuláru (frm1):
Kód:
Private Sub cmm3_Click()
ulozit
End Sub
Private Sub cmm5_Click()
If MsgBox("Ste si isty že chcete vyčistit udaje????", vbYesNo + vbExclamation, _
"Vyčistenie") = vbYes Then
For Each objekty In frm1.Controls
If objekty.Tag = "vycistit" Then
objekty.Text = ""
End If
Next objekty
End If
End Sub
Private Sub cmm6_Click()
koniec
End Sub
Private Sub mnuinfo_Click()
info
End Sub
Private Sub mnukoniec_Click()
koniec
End Sub
Kod modulu (module1):
Kód:
Public login As String
Public pass As String
Public meno As String
Public priezvisko As String
Public email As String
Public telefon As String
Public ucet As String
Public adresa As String
Public loginx As String
Public passx As String
Public menox As String
Public priezviskox As String
Public emailx As String
Public telefonx As String
Public ucetx As String
Public addresax As String
Public retazec As String
Public heslo As String
Public heslocislo As Double
Public hesloa As String
Public heslob As String
Public dlzkaretazca As String
Public dlzkahesla As String
Public dlzkaheslaa As String
Public dlzkaheslab As String
Public vyslednytext As String
Public pismeno As String
Public pismenox As Long
Public pismenoy As Long
Public kriptor As String
Public a As Long
Sub main()
Load frm1
frm1.Show
End Sub
Sub info()
MsgBox ("Súkromné informácie 1.0" & Chr(13) & Chr(10) & _
"Dátum vydania: ???" & Chr(13) & Chr(10) & "Hlavný programátor: Wpegb" & _
Chr(13) & Chr(10) & ":D :D :D :D")
End Sub
Sub koniec()
If MsgBox("Ste si isty že chcete ukončit program???? Všetky neuložené dáta budú stratené", _
vbYesNo + vbExclamation, "Koniec") = vbYes Then End
End Sub
Sub ulozit()
'da veci do premennych
login = InputBox("Zadajte prihlasovacie heno", "Login")
pass = InputBox("Zadajte heslo", "Password")
meno = frm1.Text3.Text
priezvisko = frm1.Text4.Text
email = frm1.Text5.Text
telefon = frm1.Text6.Text
ucet = frm1.Text7.Text
adresa = frm1.Text8.Text
'vytvori dlhe čiselne heslo v premennej
hesloa = login
heslob = pass
dlzkaheslaa = Len(hesloa)
For i = 1 To dlzkaheslaa
heslo = heslo & Asc(Mid(hesloa, i, 1))
Next i
dlzkaheslab = Len(heslob)
For i = 1 To dlzkaheslab
heslo = heslo & Asc(Mid(heslob, i, 1))
Next i
heslocislo = heslo
'vyčistenie premennych
hesloa = ""
heslob = ""
dlzkaheslaa = ""
dlzkaheslab = ""
'sifrovanie mena
retazec = meno
dlzkaretazca = Len(retazec)
dlzkahesla = Len(heslo)
For i = 1 To dlzkaretazca
If a = dlzkahesla Then a = 0
a = a + 1
kriptor = Mid(heslocislo, a, 1)
pismeno = Mid(retazec, i, 1)
pismenox = (Asc(pismeno)) + kriptor
pismenoy = pismenox Xor heslocislo
celytext = celytext & "#" & pismenoy
Next i
menox = celytext
End Sub
Viem že kod je zbytočne dlhy niekotre veci by sa tam dali spravit jednoduksie.
Este tu davam screen: