G
Guest
Hello,
I have only one form with a listbox:lbFileContent, and I have this code in
Public Class Form1.
Public Shared Sub UploadFile(ByVal fileNamePath As String)
Dim reader As StreamReader = New StreamReader(fileNamePath)
Try
Me.lbFileContent.Items.Clear()
Do
Me.lbFileContent.Items.Add(reader.ReadLine)
Loop Until reader.Peek = -1
Catch
Me.lbFileContent.Items.Add("File is empty")
Finally
reader.Close()
End Try
End Sub
It seems Me is not defined there. What should I do here?
Thanks,
Jim.
I have only one form with a listbox:lbFileContent, and I have this code in
Public Class Form1.
Public Shared Sub UploadFile(ByVal fileNamePath As String)
Dim reader As StreamReader = New StreamReader(fileNamePath)
Try
Me.lbFileContent.Items.Clear()
Do
Me.lbFileContent.Items.Add(reader.ReadLine)
Loop Until reader.Peek = -1
Catch
Me.lbFileContent.Items.Add("File is empty")
Finally
reader.Close()
End Try
End Sub
It seems Me is not defined there. What should I do here?
Thanks,
Jim.