Cara Membuat Form Login dengan Password yang di Enkripsi pada Visual Fox Pro Bagian 3
Pada Postingan Kali ini saya akan melanjutkan tentang Cara Membuat Form Login dengan Password yang di Enkripsi pada Visual Fox Pro, langkah selanjutnya adalah :
6. Buat Form Baru dengan struktur seperti dibawah ini
Masukkan script berikut :
Form1.text1.valid
uname=ALLTRIM(thisform.text1.Value)
IF EMPTY(uname)
MESSAGEBOX("Tidak
Boleh Kosong",0+48,"Peringatan")
thisform.Release
ENDIF
Form1.text2.valid
uname=ALLTRIM(thisform.text2.Value)
IF EMPTY(uname)
MESSAGEBOX("Tidak
Boleh Kosong",0+48,"Peringatan")
RETURN 0
ENDIF
Form1.text3.valid
uname=ALLTRIM(thisform.text2.Value)
IF EMPTY(uname)
MESSAGEBOX("Tidak
Boleh Kosong",0+48,"Peringatan")
RETURN 0
ENDIF
Form1.text4.valid
uname=ALLTRIM(thisform.text4.Value)
IF EMPTY(uname)
MESSAGEBOX("Tidak
Boleh Kosong",0+48,"Peringatan")
RETURN 0
ENDIF
form.text4.lostFocus
pwd1=ALLTRIM(thisform.text3.Value)
pwd2=ALLTRIM(thisform.text4.Value)
IF pwd1<>pwd2
MESSAGEBOX("Password
tidak sama",0+48,"Peringatan",3000)
thisform.text3.Value=""
thisform.text4.Value=""
thisform.text3.SetFocus
ELSE
replace pwd_user WITH enkripsi(pwd2)
=TABLEUPDATE(.t.,.t.,'pengguna')
MESSAGEBOX("Ganti
Password Berhasil",0+64,"Berhasil",3000)
thisform.label3.Visible= .F.
thisform.label4.Visible= .F.
thisform.text3.Visible= .F.
thisform.text4.Visible= .F.
thisform.container3.Visible= .F.
thisform.text1.SetFocus
ENDIF
Form1.commandgroup1.click
uname=ALLTRIM(thisform.text1.Value)
pwd=ALLTRIM(thisform.text2.Value)
pilih=this.Value
DO CASE
CASE pilih=1
LOCATE FOR nama_user=uname
AND deskripsi(pwd_user)=pwd
IF ! FOUND()
MESSAGEBOX("Username/Password
yang Anda masukkan salah !",0+48,"Peringatan")
thisform.text1.SetFocus
ELSE
MESSAGEBOX("Login
Berhasil",0+64,"Sukses")
ENDIF
CASE pilih=2
LOCATE FOR nama_user=uname
AND deskripsi(pwd_user)=pwd
IF ! FOUND()
MESSAGEBOX("Username/Password
yang Anda masukkan salah !",0+48,"Peringatan")
thisform.text1.SetFocus
ELSE
thisform.label3.Visible= .T.
thisform.label4.Visible= .T.
thisform.text3.Visible= .T.
thisform.text4.Visible= .T.
thisform.container3.Visible= .T.
thisform.text3.SetFocus
ENDIF
CASE pilih=3
thisform.Release
ENDCASE
mw nanya gan itu arti kata dari form1.init,form1.talkolle,form1.takrappah itu artinya apa ya gan ? atau nama lainnya ? gagal paham ane
BalasHapus