Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Advance Login with reset/recover password (Beginner lang din po ako) TUTS!

rhonrsv

Apprentice
Advanced Member
Messages
97
Reaction score
1
Points
26
Paano gumawa ng advance Login form na may reset password or recover password features?
Paano po?

Basa po muna maige,

Using Visual Studio (VB.net) Community 2017

Hi guys,

Share ko lang po sa inyo yung sample form ko sa VB.net kung paano po yung may Login form at paano yung password reset form!
Eto yung login form na may user/password required and in case naman na forgotten password, may link sa ilalim na Forgot password? then iki-click ng user para ma reset nya yung password nyaor ma-recover. Yung sample ko po ay sakin lang naman paraan kaya kung medyo sa tingin nyo ay napaka gulo ay bahala na kayo hehehe, baguhan lang din po ako at nakagawa ako nito sa pag search lang po sa web at sama samang idea. Any way try ko naman na maipaliwanag ito nang maayos hanggat kaya ko dito mga ka Symbianize.

No need nang i-master ang database, SQL or mismong VB.net kasi madali lang po ito sundan! ENJOY!!

Sa sample ko po ay gumamit ako ng mga secuiry questions like online webmail (Gmail, Yahoo etc.)
View attachment 322915

My security questions:
What was the last name of your third grade teacher?
What was the name of your second dog/cat/goldfish/etc?
Who was your childhood hero?
What is your youngest brother's birthday? (Month only)
What is your youngest sister's birthday? (Month only)
What was the name of your elementary / primary school?
In which city were you born?
What is your favorite number?
What is your favorite color?

Tapos nito ay sasagutan nila yun, depende sa nirigester nilang Security Question nung nag register sila, so... ganito !!!

Sample Form:
Kung mapapansin nyo napakagulo di ba, sabi ko nga sa thread na ito hehehe :lol:
View attachment 322917


Sa form na iyan ay makikita ang mga sumusunod:

Textboxes, Labels, Checkbox, Combox, Datagridview with 4 Columns, GroupBox and Buttons

Pero yung nakikita ninyo sa right side nyo ng monitor ay naka hide dapat at iset ang forsize ng lengthwise like PICTURE #1.1

PICTURE #1.1
View attachment 322921

This is the system flow chart!
View attachment 322930
::: napaka simple lang po di ba? :::


Start tayo sa pag design at pagbigay ng mga names sa tools natin like this example po na nasa PICTURE # 1.2

PICTURE # 1.2
View attachment 322939

Create your own design (maging creative po lagi sa pag gawa ng projects and mas simple mas maganda po syempre).
Tignan nyo po yung PICTURE # 1.2, nandyan po lahat ng names ng tools ko na ginamit at pwede nyo din namang gamitin yun para po mas madaling gamitin pag nilagay na po natin yung codes!

Yung code ay naka attached naman po dito sa linked thread:
http://www.symbianize.com/showthread.php?t=1439985&p=23033829#post23033829

dyan po sa link na yan kunin ang code at i-copy/paste sa ginawa ninyong project

:::: sa PICTURE # 1.2 po ay maari ninyong gayahin nalang yung mga name at tools na ginamit ko para mas madali na po syang gawin.

Sa datagridview naman po ay sa HTML ko na po ginawa or manual sa properties: See PICTURE # 2.1 and PICTURE # 2.2

PICTURE # 2.1
View attachment 322950

PICTURE # 2.2
View attachment 322951

Sunod po gagawa tayo ng databse natin na magiging laman naman po ng Datagridview natin.

1. Open Notepad
2. Type this sample (mas maganda kung i copy nyo nalang po din ito)

Rowel,What is your youngest sister's birthday? (Month only),November,123D3
Virgo,What is your youngest sister's birthday? (Month only),December,2558Q
Sutacio,What is your youngest sister's birthday? (Month only),January,66J88
Rona,What is your youngest sister's birthday? (Month only),February,1A23D
Maria,What is your youngest sister's birthday? (Month only),March,V12V3

Virgo = User name
What is your youngest sister's birthday? (Month only) = Security Question
November = Answer
123D3 = Password

lahat po yan ay sinusundang (,) comma as CSV or (Comma Separated Value) para malaman ng system na kung saan nya puputulin yung line at saan nya ilalagay sa next column ng datagridview.

Save as "PM_recovery.dll" at i-save po ito sa "C:\LMPM\" Folder PICTURE # 2.3

PICTURE # 2.3
View attachment 322969

Sa form load naman po ilagay itong code na ito:

Private Sub frmRECOVERY_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim lines = (From line In IO.File.ReadAllLines("C:\LMPM\PM_recovery.dll")
Select line.Split(CChar(","c))).ToArray
For x As Integer = 0 To lines.GetUpperBound(0)
DataGridView1.Rows.Add(lines(x))
Next
End Sub


ang code ay para sa pag populate ng data gridview from our databse

PICTURE # 2.4
View attachment 322970

Copy this code sa comboBox SelectedIndexChange Event

Private Sub comQUESTION_SelectedIndexChanged(sender As Object, e As EventArgs) Handles comQUESTION.SelectedIndexChanged

DataGridView1.DataBindings.Clear()
DataGridView1.Rows.Clear()

Dim lines = (From line In IO.File.ReadAllLines("C:\LMPM\PM_recovery.dll")
Select line.Split(CChar(","c))).ToArray
For x As Integer = 0 To lines.GetUpperBound(0)
DataGridView1.Rows.Add(lines(x))
Next
lblUSER.Text = txtUSER.Text
lblQUESTION.Text = comQUESTION.Text
cmdCHECK.Enabled = True

End Sub


Kung mapapansin ninyo na na ulit yung code ng pag load from text file, ito ay dahil sa una kong sample sa load form , ipinakita ko lang kung paano mag load ng text file to datagridview. NOTE: pwede naman pong i-delite na yung nasa form load or pwedeng hindi na rin!

ang code na,
DataGridView1.DataBindings.Clear()
DataGridView1.Rows.Clear()
ay para hindi ma ulit ang pag load ng text file sa datagridview kapag pumipili ng Security Question,

Paano po ba nagana ang Reset/Recover Password form po na ito?? at yung code?

Sunod ay ifi-filter natin ang sagot sa security question na napili ng user, habang nagta-type ay automatic na nag si-search ang system sa sagot na nasa data base gamit ang code na sumusunod:

(Ilagay ito sa txtANSWER) TextChange Event

Private Sub txtANSWER_TextChanged(sender As Object, e As EventArgs) Handles txtANSWER.TextChanged

lblANSWER.Text = txtANSWER.Text

If txtANSWER.Text <> "" Then
Dim s As String = lblUSER.Text.Trim
DataGridView1.ClearSelection()
DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
For Each dgr As DataGridViewRow In DataGridView1.Rows
dgr.Visible = dgr.Cells("Column1").Value.ToString.Contains(s)
Next dgr
Else
DataGridView1.ClearSelection()
End If


If txtANSWER.Text <> "" Then
Dim s As String = lblQUESTION.Text.Trim
DataGridView1.ClearSelection()
DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
For Each dgr As DataGridViewRow In DataGridView1.Rows
dgr.Visible = dgr.Cells("Column2").Value.ToString.Contains(s)
Next dgr
Else
DataGridView1.ClearSelection()
End If


If txtANSWER.Text <> "" Then
Dim s As String = lblANSWER.Text.Trim
DataGridView1.ClearSelection()
DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
For Each dgr As DataGridViewRow In DataGridView1.Rows
dgr.Visible = dgr.Cells("Column3").Value.ToString.Contains(s)
Next dgr
Else
DataGridView1.ClearSelection()
End If


End Sub


Bawat isang column from column1 to Column 3 at tig isang filter., try nyo nang i RUN ang program!

Habang ang user ay nag ta-type, ang datagridview naman ay automatic na na filter, Kung wala o kung meron match sa txtUSER, comQUESTION at txtANSWER, ibabase ito sa (kulay dilaw ng LABELS sa sample form ko) at ico-confirm naman ng (kulay berde na LABELS sa form sample ko)

at sa Button na Check password naman ay ilalagay ang code na ito para ang pag filter at pag confirm kung same details ay gumana...

Private Sub cmdCHECK_Click(sender As Object, e As EventArgs) Handles cmdCHECK.Click

DataGridView1.Rows(0).Selected = True

For Each RW As DataGridViewRow In DataGridView1.SelectedRows
lblCONUser.Text = RW.Cells(0).Value.ToString
lblCONQuestion.Text = RW.Cells(1).Value.ToString
lblCONAnswer.Text = RW.Cells(2).Value.ToString
lblCONPassword.Text = RW.Cells(3).Value.ToString
Next

lblENTERED.Text = lblUSER.Text & " " & lblQUESTION.Text & " " & lblANSWER.Text
lblDATABASE.Text = lblCONUser.Text & " " & lblCONQuestion.Text & " " & lblCONAnswer.Text

If lblENTERED.Text = lblDATABASE.Text Then
cmdSAVE.Enabled = True
txtPASSWORD.Text = lblCONPassword.Text
MsgBox(lblUSER.Text & ", you can now change your password.", vbInformation, "System says:")
Else
cmdSAVE.Enabled = False
MsgBox(lblUSER.Text & ", your answer to your security question is not valid! Please try again.", vbCritical, "System says:")
End If
End Sub


REMINDER! Please be creative at subukan aralin ang mga codes sa sariling paraan

at para naman mas masiguro na walang error (para masiguro ko lang) kasi di ko alam paano, So ginawan ko nalang ng paraan:

ang cmdSAVE.Enabled = Flase at ang cmdCHECK.Enabled = False para hindi ma click dahil nag kakaroon ako ng error! At ang mga tolls na ito ay enabled sa combo box at Check password buttons. balikan ang code at pagaralan

Add this code:

Private Sub cmdCANCEL_Click_1(sender As Object, e As EventArgs) Handles cmdCANCEL.Click
cmdSAVE.Enabled = False
cmdCHECK.Enabled = False
frmLOGIN.Show()
Me.Close()
End Sub


Sana nakatulong po ako . ENJOY!!!!

Source Code Download by Rhon RSV
Rowel Virgo

http://www.symbianize.com/showthread.php?t=1440003&p=23034027#post23034027
 

Attachments

  • Login Form.PNG
    Login Form.PNG
    17.8 KB · Views: 46
  • Form.jpg
    Form.jpg
    121 KB · Views: 45
  • Size.JPG
    Size.JPG
    64.5 KB · Views: 25
  • Flow.JPG
    Flow.JPG
    36.9 KB · Views: 35
  • Filename.JPG
    Filename.JPG
    149.6 KB · Views: 19
  • DGR.jpg
    DGR.jpg
    52.2 KB · Views: 11
  • Add.JPG
    Add.JPG
    68.5 KB · Views: 9
  • C Code.JPG
    C Code.JPG
    39.2 KB · Views: 10
  • LOAD Form DRG.JPG
    LOAD Form DRG.JPG
    88.3 KB · Views: 12
Last edited:
Back
Top Bottom