' Returns the content of the specified text file
' Note: it can throw an exception
' Usage: Dim FileContent As String = LoadTextFile("C:\Autoexec.bat")
Function LoadTextFile(ByVal FilePath As String) As String
Dim sr As System.IO.StreamReader
Try
sr = New System.IO.StreamReader(FilePath)
LoadTextFile = sr.ReadToEnd()
Finally
If Not sr Is Nothing Then sr.Close()
End Try
End Function