========================
附:程序代码
========================
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private a(100000) As String
Public m, n, s As Integer
Private Sub Command1_Click()
Open "load.txt" For Output As #1
Print #1, n
Close
Text1 = "『保存成功!』"
Text1.SetFocus
End Sub
Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = True
On Error GoTo handler1
Open "test.txt" For Input As #5
Do Until EOF(5)
n = n + 1
Line Input #5, b$
a(n) = b$
Loop
m = n
n = 0
Close
Open "load.txt" For Input As #1
Line Input #1, b$
n = Val(b$)
Close
Text1 = a(n)
Exit Sub
handler1:
Open "test.txt" For Append As #1
Close
Open "load.txt" For Output As #1
Print #1, 0
Text1 = "『读取文件失败』"
Exit Sub
Close
End Sub
Private Sub text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then c = Int(Abs(Val(text2))): If c < m Then n = c: Text1 = a(n): Text1.SetFocus
End Sub
Private Sub Timer1_Timer()
If s = 0 Then
If GetAsyncKeyState(vbKeySpace) = -32767 Or GetAsyncKeyState(vbKeyN) = -32767 Then If n < m Then n = n + 1: Text1 = a(n)
If GetAsyncKeyState(vbKeyB) = -32767 Then If n > 1 Then n = n - 1: Text1 = a(n)
End If
If GetAsyncKeyState(vbKeyS) = -32767 Then If s = 0 Then s = 1: Text1 = "【游戏字幕暂停中……】" Else s = 0: Text1 = "【暂停取消】"
Label1 = Format(n) & " / " & Format(m)
If GetAsyncKeyState(vbKeyP) = -32767 Then Command1_Click