Write an event procedure to encrypt a given string.Design an interactive user interface.Use approprite controls.
Assumptions : Encryption Logic is Display Next Character ,That is ,display b for a
Refer another type of this Program Encryption and Decryption .
(A) Program Design :
(B) Property(Controls Used) :
(C) Attaching Code to the Object :
===========================================================================
Back to Home & VB
Assumptions : Encryption Logic is Display Next Character ,That is ,display b for a
Refer another type of this Program Encryption and Decryption .
(A) Program Design :
- 2 Labels : Captions - Inut and Output)
- 2 TextBoxes : Delete Text
- 2 Command Buttons : Captions - Encrypt and Decrypt
(C) Attaching Code to the Object :
Private Sub Command1_Click() Dim code_str As String code_str = "" For i = 1 To Len(Text1.Text) ch = Mid(Text1.Text, i, 1) code = Asc(ch) + 1 ch = Chr(code) code_str = code_str + ch Next Text2.Text = code_str End Sub |
Private Sub Command2_Click() Dim code_str As String code_str = "" For i = 1 To Len(Text1.Text) ch = Mid(Text1.Text, i, 1) code = Asc(ch) - 1 ch = Chr(code) code_str = code_str + ch Next Text2.Text = code_str End Sub |
===========================================================================
Back to Home & VB
No comments:
Post a Comment