O'Reilly logo

Developing Microsoft® .NET Controls with Microsoft Visual Basic® .NET by John Connell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Examining the Control That Interacts with the Encrypt Class

If the password hash exists, pass on the entry to the Password method of our Encryption class to start things off. If the password hash doesn’t exist, the CreatePassword routine is called.

Private Sub cmdPassword_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles cmdPassword.Click

    '-- Here the user does not have a password - it's not in resources file
    If (Enc.DoesPasswordExist = False) Then
        CreatePassword()
    Else
        Enc.Password(Trim(tbPassword.Text))
    End If

    If Enc.isEncryptionInitialized = True Then
        enableControls(True)
        lbEncrypted.Enabled = False
        updateEncryptedFiles()
        lblEncrypt.Text = "Select file to en/decrypt"
    End If
End Sub

As mentioned earlier, we want the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required