By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,705 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,705 IT Pros & Developers. It's quick & easy.

Password form

P: n/a
Hi
I am having difficulty getting a password form to work correctly.
I am using VB.Net.
The required functionality is to allow a change to a setting but when a save
button is clicked a password box opens requiring the password. If a correct
password is entered then the new setting/s are saved otherwise the old
settings are re-instated.

The save button calls a sub
The Sub opens the password form.
The password form checks the password and sets a global variable to true and
then hides
The Sub then saves the settings to the registry
I can't see where it is going wrong.
I would appreciate someone having a quick look at this and letting me know
if I am doing this the wrong way or if I am just making some mistake in the
code.

The code is below,

Thanks Doug

Form Declarations:
Private mPssWrdForm As FormPssWrd

Save Button code:
Call dacSaveSettings()

dacSaveSettings code:
'Display Password Form.

If mPssWrdForm Is Nothing Then

mPssWrdForm = New FormPssWrd

mPssWrdForm.ShowDialog()

Else

If mPssWrdForm.Visible = False Then

mPssWrdForm.Visible = True

End If

mPssWrdForm.Activate()

End If

'Check Password

If gfPssWrdOK Then

'Password OK

'Save Target Folder

gfPssWrdOK = False

gstTargetFolder = LabelTfrTo.Text

fSaveFailed = Not dacSetRegSettings("DestFolder", gstTargetFolder)

If fSaveFailed Then

GoTo Err_dacSaveSettings

End If

Else

LabelTfrTo.Text = gstTargetFolder

Call dacSetUpLdfreq()

CheckBoxEnable.Checked = gfEnableRun

End If

Exit_dacSaveSettings:

fFormChanged = False

Exit Sub

Err_dacSaveSettings:

MsgBox("Error Saving changes.", MsgBoxStyle.Information, _

"24x7 File Transfer Error")

GoTo Exit_dacSaveSettings

End Sub

Password Form Code:
Private Sub ButtonPsswd_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) _

Handles ButtonPsswd.Click

gfPssWrdOK = LCase(TextBoxPsswd.Text) = LCase(gstPassWord)

TextBoxPsswd.Text = ""

Me.Hide()

End Sub


Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.