I haven't worked with a PPC in some time and thus a bit rusty, but looking
over some of my code, here is a simple example of reading a text file that
is in the application path and displaying the results. The commented out
code is for larger text files.
Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnRead.Click
Dim BasePath As String =
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim Path As String = BasePath & "\Test3.txt"
If System.IO.File.Exists(Path) Then
Dim sr As New System.IO.StreamReader(Path)
MsgBox(sr.ReadToEnd)
sr.Close()
sr = Nothing
'Dim fs As System.IO.FileStream = System.IO.File.Create(Path)
'fs = System.IO.File.OpenRead(Path)
'Dim b(1024) As Byte
'Dim temp As System.Text.UTF8Encoding = New
System.Text.UTF8Encoding(True)
'Dim s As String = ""
'Do While fs.Read(b, 0, b.Length) > 0
' s = s & temp.GetString(b, 0, b.Length)
'Loop
'MsgBox(s)
'fs.Close()
'fs = Nothing
End If
End Sub