Dim sAllText As String = ""
Dim arrByte() As Byte = File.ReadBytes(sDir, sFile)
Dim bSuccess As Boolean = False
Try
sAllText = BytesToString(arrByte, 0, arrByte.Length, "UTF8")
bSuccess = True
Catch
Log(LastException)
End Try
If bSuccess = False Then
Try
sAllText = BytesToString(arrByte, 0, arrByte.Length, "Windows-1252")
bSuccess = True
Catch
Log(LastException)
End Try
End If
If bSuccess = False Then
Try
sAllText = BytesToString(arrByte, 0, arrByte.Length, "UTF7")
bSuccess = True
Catch
Log(LastException)
End Try
End If
If bSuccess = False Then Return Null