- Joined
- Mar 13, 2001
im makeing a small app to help me add entries to the hosts file in windows
i got most of it down except
when i
i know hosts insnt in c:\ its just a test file till i get it working
i get one line in the hosts file then it will over write that same line
how do i get streamwriter to read the lentgh of the file then increment it down one to add my entire?
i got most of it down except
when i
Code:
Dim hostwriter As New StreamWriter("c:\hosts.txt")
'Write line to hosts file
hostwriter.WriteLine(vbNewLine & "127.0.0.1 ".PadRight(10) & TextBox1.Text.PadRight(5) & " #Blocked by Robert Barbrow")
hostwriter.Close()
i know hosts insnt in c:\ its just a test file till i get it working
i get one line in the hosts file then it will over write that same line
how do i get streamwriter to read the lentgh of the file then increment it down one to add my entire?