home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 6 Unleashed…sional Reference Edition) / Visual_Basic_6_Unleashed_Professional_Reference_Edition_Sams_1999.iso / Source / CHAP29 / 309X3207.TXT < prev    next >
Encoding:
Text File  |  1998-05-05  |  479 b   |  21 lines

  1.  
  2. Private Sub ReadFile()
  3.  
  4. Dim intFileNum As Integer
  5. Dim strLineIn As String
  6.  
  7. ' Re-read the current INI file and display it
  8. ' in the list box lstFileContents.
  9. lstFileContents.Clear
  10. If Dir$(dlgGetFilename.FileName) <> "" Then
  11.     intFileNum = FreeFile
  12.     Open dlgGetFilename.FileName For Input As #intFileNum
  13.     While Not EOF(1)
  14.         Line Input #intFileNum, strLineIn
  15.         lstFileContents.AddItem strLineIn
  16.     Wend
  17.     Close #intFileNum
  18. End If
  19.  
  20. End Sub
  21.