Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WIN95\SYSTEM\STDOLE2.TLB#OLE Automation
IconForm="Form1"
Startup="Form1"
HelpFile=""
Title="工程1"
ExeName32="工程1.exe"
Command32=""
Name="工程1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Geworm Studio"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
ThreadPerObject=0
MaxNumberOfThreads=1
-----------------------------------------------------------------------------
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "老虎机"
   ClientHeight    =   2556
   ClientLeft      =   48
   ClientTop       =   276
   ClientWidth     =   3744
   LinkTopic       =   "Form1"
   ScaleHeight     =   2556
   ScaleWidth      =   3744
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   3348
      Top             =   1224
   End
   Begin VB.CommandButton Command2 
      Caption         =   "start"
      Height          =   312
      Left            =   2676
      TabIndex        =   6
      Top             =   660
      Width           =   1044
   End
   Begin VB.CommandButton Command1 
      Caption         =   "start"
      Height          =   312
      Index           =   2
      Left            =   1896
      TabIndex        =   5
      Top             =   1380
      Width           =   648
   End
   Begin VB.CommandButton Command1 
      Caption         =   "start"
      Height          =   312
      Index           =   1
      Left            =   1140
      TabIndex        =   4
      Top             =   1380
      Width           =   648
   End
   Begin VB.CommandButton Command1 
      Caption         =   "start"
      Height          =   312
      Index           =   0
      Left            =   372
      TabIndex        =   3
      Top             =   1380
      Width           =   648
   End
   Begin VB.Label Label1 
      BorderStyle     =   1  'Fixed Single
      Height          =   600
      Index           =   2
      Left            =   1860
      TabIndex        =   2
      Top             =   540
      Width           =   600
   End
   Begin VB.Label Label1 
      BorderStyle     =   1  'Fixed Single
      Height          =   600
      Index           =   1
      Left            =   1116
      TabIndex        =   1
      Top             =   540
      Width           =   600
   End
   Begin VB.Label Label1 
      BorderStyle     =   1  'Fixed Single
      Height          =   600
      Index           =   0
      Left            =   396
      TabIndex        =   0
      Top             =   540
      Width           =   600
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim number(0 To 2) As Integer
Dim totalwon As Integer, nroll As Integer
Private Sub Win()
If totalwon < 10 Then
    totalwon = totalwon + 1
    MsgBox "You Win"
    Command2_Click
Else
    number(nroll) = (number(nroll) + 1) Mod 10
    Label1(nroll).Caption = Str(number(nroll))
End If
End Sub
Private Sub Command1_Click(Index As Integer)
If Command1(Index).Caption = "start" Then
    For i = 0 To 2
        If i <> Index Then Command1(i).Enabled = False
    Next i
    Command1(Index).Caption = "stop"
    nroll = Index
    Timer1.Enabled = True
Else
    For i = 0 To 2
        If i <> Index Then Command1(i).Enabled = True
    Next i
    Timer1.Enabled = False
    Command1(Index).Caption = "start"
    If number(0) = number(1) And number(1) = number(2) Then Win
End If
End Sub
Private Sub Command2_Click()
a: For i = 0 To 2
    number(i) = Int(Rnd * 10)
Next i
If number(1) = number(2) Then GoTo a '不使数据一开始就重复
For i = 0 To 2
    Label1(i).Caption = Str(number(i))
Next i
End Sub
Private Sub Form_Load()
On Error GoTo b
Randomize Timer
Open "abc.txt" For Input As #1
    Input #1, dt '读入日期
    Input #1, totalwon
    If dt <> Date Then totalwon = 0
Close
Exit Sub
b: totalwon = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Open "abc.txt" For Output As #1
    Write #1, Date '写入日期
    Write #1, totalwon
Close
End Sub

Private Sub Timer1_Timer()
number(nroll) = (number(nroll) + 1) Mod 10
Label1(nroll).Caption = Str(number(nroll))
End Sub