Guest boskomihic Posted August 8, 2002 Posted August 8, 2002 What have I to set up so I can start using StreamReader or StreamWriter? Quote
Guest bananafish Posted August 9, 2002 Posted August 9, 2002 (edited) Here is one example of using Stream Reader Private Function ReadIniFile() As ArrayList '**************************************** '* Read the Ini File into an Array List * '**************************************** Dim srIniFile As System.IO.StreamReader Dim strFilePath As String Dim alFile As ArrayList = New ArrayList() Dim strRec As String Try mintTotal = 0 strFilePath = Path.ChangeExtension([Assembly].GetExecutingAssembly.Location, "ini") srIniFile = System.IO.File.OpenText(strFilePath) '******************************* '* Read the File * '******************************* Do strRec = srIniFile.ReadLine() If strRec <> Nothing Then alFile.Add(strRec) mintTotal += 1 End If Loop Until strRec = Nothing Return alFile Catch ex As Exception moErr.LogError(ex) Finally If Not srIniFile Is Nothing Then srIniFile.Close() End If End Try End Function Edited August 9, 2002 by Derek Stone Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.