i need codes for editing the host file
i need codes for editing the host file
It has nothing to do with VB but here it is:
Open up your C:\ Drive
navigate to "windows"
navigate to "system32"
navigate to "drivers"
navigate to "ect"
open "hosts" with admin privileges in notepad
type the destination IP first, then a space, then the website to which you want to make the computer navigate to the IP you previously wrote
EX:
127.0.0.1 is also localhost (nothing)Code:127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com
127.0.0.1 activate.adobe.com
the above example is how to block adobe updater in order to crack cs5
Obviously he wanted to know how to do it programmatically, otherwise he wouldn't have asked.
You can either use IO.File.AppendText or an IO.StreamWriter with "Append" set to true. Write the "IP sitename" as mnpeep did above and write each to a new line. An example:
[highlight=vb.net]
Using sWriter As New IO.StreamWriter"C:\Windows\System32\drivers\etc\ho st", True)
sWriter.WriteLine("127.0.0.1 LocalHost")
End Using
[/highlight]
Whoops only saw the write...
Marked as solved, no more posting unless you have an iron-clad reason to.