[Help] Codes for adding sites to be blocked in Host File [Solved]

Posts 1–8 of 8 · Page 1 of 1
[Help] Codes for adding sites to be blocked in Host File [Solved]
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:

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
127.0.0.1 is also localhost (nothing)

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]
Quote Originally Posted by Jason View Post
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]
ok got it, but shouldn't it be:

sWriter.Writeline(vbcrlf & IPTextbox.text & " " & Websitetextbox.text)

??? make it so the user can add lines and use a textbox to type in the text?
Quote Originally Posted by mnpeepno2 View Post
ok got it, but shouldn't it be:

sWriter.Writeline(vbcrlf & IPTextbox.text & " " & Websitetextbox.text)

??? make it so the user can add lines and use a textbox to type in the text?
Was an example of how to use the StreamWriter and how to set out the names...can't just assume textbox names etc . Also you don't need to add a new CrLf character...what's the point of WriteLine then?
Quote Originally Posted by Jason View Post
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]
tried ur code, the problem is, instead of appending the new line, it clears everything and saves the new line.

~edit~

tried with append, done,

thx for the help, appreciate it very much
Whoops only saw the write...
Marked as solved, no more posting unless you have an iron-clad reason to.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?