凯撒密码VB方法
Form1 = 44, 58, 635, 507, C, 16, 50, 607, 499, C
Form2 = 84, 99, 675, 548, C, 60, 19, 651, 468, C
Form3 = -2, 0, 741, 551, , 42, 8, 706, 539, C
Form4 = 16, 28, 722, 604, C, 36, 11, 710, 533, C
Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation
Form=Form2.frm
Form=Form3.frm
Form=Form4.frm
IconForm="Form1"
Startup="Form1"
ExeName32="凯撒.exe"
Path32="0408008402刘夏毓\VB方法"
Command32=""
Name="工程1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="JUJUMAO"
CompilationType=0
凯撒密码VB方法
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1
VERSION 5.00
Begin VB.Form Form4
Caption = "Form4"
ClientHeight = 5325
ClientLeft = 60
ClientTop = 450
ClientWidth = 8955
LinkTopic = "Form4"
ScaleHeight = 5085
ScaleMode = 0 'User
ScaleWidth = 8445
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 6600
TabIndex = 10
Top = 4320
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "清除"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3840
TabIndex = 9
Top = 4320
Width = 1935
若图片无法显示请联系QQ752018766,凯撒密码VB方法系统免费,转发请注明源于www.751com.cn
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1080
TabIndex = 8
Top = 4320
Width = 1815
End
Begin VB.Frame Frame2
Caption = "输出数据框"
Height = 3495
Left = 5040
TabIndex = 1
Top = 480
Width = 3735
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 7
Top = 1440
Width = 3015
End
Begin VB.Label Label3
Caption = "明文为:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 6
Top = 840
Width = 1575
End
End
Begin VB.Frame Frame1
Caption = "输入数据框"
Height = 3495
Left = 360
TabIndex = 0
Top = 480
Width = 4095
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 5
Top = 1800
Width = 2295
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1440
TabIndex = 4
Top = 720
Width = 2295
End
Begin VB.Label Label2
Caption = "请输入密钥:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 3
Top = 1920
Width = 1455
End
Begin VB.Label Label1
Caption = "请输入秘文:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 2
Top = 840
Width = 1455
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Function f(ByVal a As String, k As Integer) As String
If ((Asc(a) >= 65 And Asc(a) <= 90)) And Len(a) = 1 Then
If ((Asc(a) - k Mod 26) < 65) Then
m = Asc(a) - k Mod 26 + 26
f = Chr(m + 32)
Else
f = Chr(Asc(a) - k Mod 26 + 32)
End If
End If
End Function
Private Sub Command1_Click()
Dim shuru As String
Dim shuchu As String
Dim k As Integer
Dim n As Integer
Dim i As Long
Dim tmp As String
If Not IsNumeric(Text2.Text) Then
MsgBox "输入的密钥应为数字!", 64, "信息提示"
Text2.Text = ""
Else
k = Text2.Text
End If
shuru = Text1.Text '要解密的字符串
For i = 1 To Len(shuru)
tmp = Mid(shuru, i, 1)
tmp = f(tmp, k)
If tmp <> "error" Then
shuchu = shuchu + tmp
Else
MsgBox "字符串中含有非法字符"
Exit Sub
End If
Next i
Text3.Text = shuchu
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command3_Click()
Form4.Hide
Form2.Show
End SubVERSION 5.00
Begin VB.Form Form3
Caption = "Form3"
ClientHeight = 5085
ClientLeft = 60
ClientTop = 450
ClientWidth = 8445
LinkTopic = "Form3"
ScaleHeight = 5085
ScaleWidth = 8445
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "清除"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3480
TabIndex = 10
Top = 4320
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 5880
TabIndex = 3
Top = 4320
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "加密"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 840
TabIndex = 2
Top = 4320
Width = 1815
End
Begin VB.Frame Frame2
Caption = "输出数据框"
Height = 3255
Left = 4680
TabIndex = 1
Top = 720
Width = 3135
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 9
Top = 1320
Width = 2295
End
Begin VB.Label Label3
Caption = "密文为:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 8
Top = 720
Width = 1335
End
End
Begin VB.Frame Frame1
Caption = "输入数据框"
Height = 3255
Left = 480
TabIndex = 0
Top = 720
Width = 3615
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
若图片无法显示请联系QQ752018766,凯撒密码VB方法系统免费,转发请注明源于www.751com.cn
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1440
TabIndex = 5
Top = 720
Width = 2055
End
Begin VB.Label Label2
Caption = "请输入密钥:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 6
Top = 2040
Width = 1455
End
Begin VB.Label Label1
Caption = "请输入明文:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 4
Top = 840
Width = 1455
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Function f(ByVal a As String, k As Integer) As String
If ((Asc(a) >= 97 And Asc(a) <= 122)) And Len(a) = 1 Then
If ((Asc(a) + k Mod 26) > 122) Then
m = Asc(a) + k Mod 26 - 26
f = Chr(m - 32)
Else
f = Chr((Asc(a) + k Mod 26) - 32)
End If
End If
End Function
Private Sub Command1_Click()
Dim shuru As String
Dim shuchu As String
Dim k As Integer
Dim n As Integer
Dim i As Long
Dim tmp As String
If Not IsNumeric(Text2.Text) Then
MsgBox "输入的密钥应为数字!", 64, "信息提示"
Text2.Text = ""
Else
k = Text2.Text
End If
shuru = Text1.Text
For i = 1 To Len(shuru)
tmp = Mid(shuru, i, 1)
tmp = f(tmp, k)
If tmp <> "error" Then
shuchu = shuchu + tmp
Else
MsgBox "字符串中含有非法字符"
Exit Sub
End If
Next i
Text3.Text = shuchu
End Sub
Private Sub Command2_Click()
Form3.Hide
Form2.Show
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End SubVERSION 5.00
Begin VB.Form Form2
Caption = "Form2"
ClientHeight = 3585
ClientLeft = 60
ClientTop = 450
ClientWidth = 5055
LinkTopic = "Form2"
ScaleHeight = 3585
ScaleWidth = 5055
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2760
TabIndex = 5
Top = 2760
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 360
TabIndex = 4
Top = 2760
Width = 1695
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 375
Left = 1200
TabIndex = 1
Top = 1760
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 375
Left = 1200
TabIndex = 0
Top = 1050
Width = 255
End
Begin VB.Label Label2
Caption = "解密"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1560
TabIndex = 3
Top = 1800
Width = 1215
End
Begin VB.Label Label1
Caption = "加密"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 2
Top = 1080
Width = 1215
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Form2.Hide
If Option1.Value = True Then
Form3.Show
Else
Form4.Show
End If
End Sub
Private Sub Command2_Click()
End
End Sub
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5205
ClientLeft = 60
ClientTop = 450
ClientWidth = 8280
ForeColor = &H000000FF&
LinkTopic = "Form1"
ScaleHeight = 5205
ScaleWidth = 8280
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 3000
TabIndex = 1
Top = 3240
Width = 2055
End
Begin VB.Label Label1
Caption = "欢迎进入凯撒密码世界!"
BeginProperty Font
Name = "宋体"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 615
Left = 1200
TabIndex = 0
Top = 1680
Width = 6015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Form1.Hide
Form2.Show
End Sub