home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm6_1_3
- Caption = "Read File"
- ClientHeight = 2595
- ClientLeft = 1095
- ClientTop = 1590
- ClientWidth = 3495
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2595
- ScaleWidth = 3495
- Begin VB.PictureBox picItem
- Height = 375
- Left = 120
- ScaleHeight = 315
- ScaleWidth = 3195
- TabIndex = 3
- Top = 2040
- Width = 3255
- End
- Begin VB.CommandButton cmdDisplay
- Caption = "Display First Item of File"
- Default = -1 'True
- Height = 495
- Left = 120
- TabIndex = 2
- Top = 1320
- Width = 3255
- End
- Begin VB.TextBox txtName
- Height = 285
- Left = 1440
- TabIndex = 1
- Top = 840
- Width = 1935
- End
- Begin VB.Label lblFiles
- Caption = "The available files are: HUMOR.TXT, INSULTS.TXT, and SECRET.TXT."
- Height = 375
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 3255
- End
- Begin VB.Label lblName
- Caption = "Name of file to open"
- Height = 495
- Left = 120
- TabIndex = 0
- Top = 720
- Width = 1215
- End
- Attribute VB_Name = "frm6_1_3"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdDisplay_Click()
- Dim passWord As String, info As String
- If UCase(txtName.Text) = "SECRET.TXT" Then
- Do
- passWord = UCase(InputBox("What is the password?"))
- Loop Until passWord = "SHAZAM"
- End If
- Open App.Path & "\" & txtName.Text For Input As #1
- Input #1, info
- picItem.Cls
- picItem.Print info
- Close #1
- End Sub
-