I was wrote a simple function to write info to text file, but there is a error message: "Referenced object has a value of Nothing." in line 4, this is what I followed exactly the book... anyone can help?
Public Function WriteLog(ByVal sVal As String) As Boolean
WriteLog = False
Try
Dim oWriter As StreamWriter = File.AppendText(sFilePath)
oWriter.WriteLine(sVal)
WriteLog = True
Catch e As Exception
End Try
End Function
Public Function WriteLog(ByVal sVal As String) As Boolean
WriteLog = False
Try
Dim oWriter As StreamWriter = File.AppendText(sFilePath)
oWriter.WriteLine(sVal)
WriteLog = True
Catch e As Exception
End Try
End Function