?? 加密.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "例[8-14]加密"
ClientHeight = 2235
ClientLeft = 60
ClientTop = 345
ClientWidth = 4410
LinkTopic = "Form1"
ScaleHeight = 2235
ScaleWidth = 4410
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txtRecode
Height = 495
Left = 1178
TabIndex = 5
Top = 1590
Width = 3135
End
Begin VB.CommandButton cmdRecode
Caption = "解密"
Height = 495
Left = 98
TabIndex = 4
Top = 1590
Width = 975
End
Begin VB.TextBox txtCode
Height = 495
Left = 1178
TabIndex = 3
Top = 870
Width = 3135
End
Begin VB.CommandButton cmdcode
Caption = "加密"
Height = 495
Left = 98
TabIndex = 2
Top = 870
Width = 975
End
Begin VB.TextBox txtInput
Height = 495
Left = 1178
TabIndex = 1
Top = 150
Width = 3135
End
Begin VB.Label Label1
Caption = "輸入字符串"
Height = 495
Left = 98
TabIndex = 0
Top = 270
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdcode_Click() '加密
Dim strInput$, Code$, Record$, c As String * 1
Dim i%, length%, iAsc%
strInput = txtInput.Text
length = Len(RTrim(strInput)) '去掉字符串右邊的空格,求真正的長度
Code = ""
For i = 1 To length
c = Mid$(strInput, i, 1) '取第i個字符
Select Case c
Case "A" To "Z" '大寫字母加序數3加密
iAsc = Asc(c) + 3
If iAsc > Asc("Z") Then iAsc = iAsc - 26 '加密后字母超過Z
Code = Code + Chr$(iAsc)
Case "a" To "z"
iAsc = Asc(c) + 3 '小寫字母加序數3加密
If iAsc > Asc("z") Then iAsc = iAsc - 26 '加密后字母超過z
Code = Code + Chr$(iAsc)
Case Else '當第i個字符為其它字符時不加密
Code = Code + c
End Select
Next i
txtCode.Text = Code '顯示加密后的字符串
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -