You could try:
vb Code:
  1. Dim strHostsFile As String = "c:\windows\system32\drivers\etc\hosts"
  2.  
  3. Dim AllLines() As String
  4. If IO.File.Exists(strHostsFile) Then
  5.     AllLines = IO.File.ReadAllLines(strHostsFile)
  6.     For Each line As String In AllLines
  7.         If Not line.StartsWith("#") AndAlso line <> "" Then TextBox1.AppendText(line & Environment.NewLine)
  8.     Next line
  9. End If