请各位帮忙改一下.
[此贴子已经被作者于2007-6-2 12:23:18编辑过]
[此贴子已经被作者于2007-6-2 12:23:18编辑过]
源码给你参考,昨天晚上半夜3点写的。可能写很乱,或许有更简单的方法。
Private Sub Form_Load()
If App.PrevInstance Then
MsgBox "嘿嘿,你是不是,不记得你已经开了一个", 32, "不给你多开~呵呵"
End
End If
If Dir("C:\WINDOWS\system32\ci.dat") <> "" Then
Open "C:\WINDOWS\system32\ci.dat" For Input As #1
Input #1, sTmp
t1.Text = sTmp
Close #1
Else
MsgBox "你还可以使用最后4次", 64, "期限"
GoTo pk
End If
If Val(t1.Text) = 0 Then
MsgBox "你已经超过有效使用次数", 16, "你无权使用"
End
Else
MsgBox "你还可以使用最后" & t1.Text & "次", 64, "期限"
t1.Text = Val(t1.Text) - 1
Open "C:\WINDOWS\system32\ci.dat" For Output As #1
Print #1, t1.Text
Close #1
End If
Exit Sub
pk:
Open "C:\WINDOWS\system32\ci.dat" For Output As #1
Print #1, t1.Text
Close #1
End Sub
Dim i%
Private Sub Command1_Click()
If Text1.Text = "ny" And Text2.Text = "123" Then
Form1.Hide: MsgBox "欢迎进入"
ElseIf i < 3 Then
MsgBox "你还有" & 3 - i & "次机会", 64, "提醒"
i = i + 1
ElseIf i >= 3 Then
Text1.Enabled = False
Text2.Enabled = False
MsgBox "你将永远被禁止登陆"
Open "C:\WINDOWS\system32\ci.dat" For Output As #1
Print #1, Text1.Text
Close #1
Command1.Enabled = False
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
If Dir("C:\WINDOWS\system32\ci.dat") <> "" Then
MsgBox "你已经永远被禁止", 16, "永远无法使用该程序"
End If
End Sub
[此贴子已经被作者于2007-6-2 11:33:17编辑过]