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




Reply With Quote