-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm2.frm
112 lines (111 loc) · 2.9 KB
/
Form2.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form2
ClientHeight = 4590
ClientLeft = 60
ClientTop = 345
ClientWidth = 5385
Icon = "Form2.frx":0000
LinkTopic = "Form1"
ScaleHeight = 1000
ScaleMode = 0 'User
ScaleWidth = 1000
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin MSComDlg.CommonDialog CommonDialog1
Left = 2400
Top = 2040
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DefaultExt = "txt"
DialogTitle = "请选择您的密码本"
Filter = "文本文件(*.txt) |*.txt|所有文件(*.*) |*.*"
FilterIndex = 1
End
Begin VB.CommandButton Command1
Caption = "汉字转报码"
Default = -1 'True
Height = 615
Left = 3240
TabIndex = 1
Top = 480
Width = 1935
End
Begin VB.TextBox Text1
Height = 4095
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 120
Width = 2895
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()
Y = Text1
Z = ""
For i = 1 To Len(Y)
a(i) = Mid(Y, i, 1)
Next
For i = 1 To Len(Y)
For X = 1 To counts
If a(i) = Left(strd1(X), 1) Then
a(i) = Mid(strd1(X), 2)
Exit For
End If
DoEvents
Next X, i
For i = 1 To Len(Y)
Z = Z & a(i) & " "
Next
Text1 = Z
Clipboard.Clear
Clipboard.SetText Text1
Text1.SetFocus
End Sub
Private Sub Form_Load()
TT = Text1.Top
TL = Text1.Left
TW = Text1.Width
TH = Text1.Height
CMT = Command1.Top
CML = Command1.Left
CMW = Command1.Width
CMH = Command1.Height
SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, 1 Or 2
counts = 0
CommonDialog1.InitDir = App.Path
CommonDialog1.ShowOpen
If Len(CommonDialog1.FileName) = 0 Then
End
End If
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
counts = counts + 1
ReDim Preserve strd1(counts) As String
Line Input #1, strd1(counts)
Loop
Close
End Sub
Private Sub Form_Resize()
On Error Resume Next
Me.ScaleHeight = 1000
Me.ScaleWidth = 1000
Text1.Top = TT
Text1.Left = TL
Text1.Width = TW
Text1.Height = TH
Command1.Top = CMT
Command1.Left = CML
Command1.Width = CMW
Command1.Height = CMH
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub