Help (Editing Hosts File)

Status
Not open for further replies.
Reputation
0
Hello,


I have found a tutorial on H***F***** about editing the hosts file in VB.net / C# but when I use the code, it erases all of the content previously placed in the hosts file. Is there a way for me to keep all of the content from the file then add my content. If also possible, how would I delete the content that I just wrote when the user presses a button ?

Regards,
TeraByTe
 
You could open the current file into a multiline text box, then add the lines of code you wanted and save it using file stream.

As for deleting modifications your best bet is to make a copy of the old file and then when the user presses the button it deletes the new file and or replaces it with the old one.

We have a batch virus tutorial which edits the host file. Maybe that would help you out a bit?
I would link it if i wasn't on my phone.

If you want specifc code, let me know
 
Or Right Click on hosts file Run as Administrator
 
@Ropic, he wasnt looking how to edit it, he was looking how to create a application which would edit it for him i believe :)
 
Status
Not open for further replies.
Back
Top