Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

Encrypto

Browsing frmMain.vb (2.97 KB)

Option Explicit On

Public Class frmMain

    Private Sub txtKey_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtKey.GotFocus

        lblKey.Font = New Font(lblKey.Font, FontStyle.Bold)

    End Sub

    Private Sub txtKey_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtKey.LostFocus

        lblKey.Font = New Font(lblKey.Font, FontStyle.Regular)

    End Sub

    Private Sub txtInput_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInput.GotFocus

        lblInput.Font = New Font(lblInput.Font, FontStyle.Bold)

    End Sub

    Private Sub txtInput_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInput.LostFocus

        lblInput.Font = New Font(lblInput.Font, FontStyle.Regular)

    End Sub

    Private Sub radEncrypt_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles radEncrypt.GotFocus

        lblMethod.Font = New Font(lblMethod.Font, FontStyle.Bold)

    End Sub

    Private Sub radEncrypt_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles radEncrypt.LostFocus

        lblMethod.Font = New Font(lblMethod.Font, FontStyle.Regular)

    End Sub

    Private Sub radDecrypt_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles radDecrypt.GotFocus

        lblMethod.Font = New Font(lblMethod.Font, FontStyle.Bold)

    End Sub

    Private Sub radDecrypt_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles radDecrypt.LostFocus

        lblMethod.Font = New Font(lblMethod.Font, FontStyle.Regular)

    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click

        Me.Close()

    End Sub

    Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click

        If txtKey.Text = "" Then

            MessageBox.Show("Please type the security key.", _
                Application.ProductName, MessageBoxButtons.OK, _
                MessageBoxIcon.Exclamation)

            txtKey.Focus()
            Exit Sub

        ElseIf txtInput.Text = "" Then

            MessageBox.Show("Please type the input text.", _
                Application.ProductName, MessageBoxButtons.OK, _
                MessageBoxIcon.Exclamation)

            txtInput.Focus()
            Exit Sub

        End If

        txtOutput.Text = ""

        Try

            Dim sec As New clsSecurity(txtKey.Text)

            If radEncrypt.Checked Then

                txtOutput.Text = sec.Encrypt(txtInput.Text)

            Else

                txtOutput.Text = sec.Decrypt(txtInput.Text)

            End If

        Catch ex As Exception

            MessageBox.Show("Error: " + ex.Message, _
                Application.ProductName, MessageBoxButtons.OK, _
                MessageBoxIcon.Error)

        End Try

    End Sub

End Class

Download frmMain.vb

Back to file list


Back to project page