|
-
Jan 15th, 2012, 02:02 AM
#1
Thread Starter
Member
need help replacing host file in my program
ok wot i want to do is replace the host file in windows so basically i want to make a button that says change host file so when click i have a host file in resources so when i click the button i want to to overight the old one with the new one but the C:/windows/system32/drivers/ect then hosts is there i way i can change it tho my program can some one help please
Last edited by elfenliedtopfan5; Jan 15th, 2012 at 02:03 AM.
Reason: title wos wrong
-
Jan 15th, 2012, 05:07 AM
#2
Hyperactive Member
Re: need help replacing host file in my program
Why would you want to overwrite a host file??
If you need Hostname to IP Address lookup within your program, can you not just have a local text/ini file with the required contents?
-
Jan 15th, 2012, 05:09 AM
#3
Thread Starter
Member
Re: need help replacing host file in my program
 Originally Posted by drawlings
Why would you want to overwrite a host file??
If you need Hostname to IP Address lookup within your program, can you not just have a local text/ini file with the required contents?
there is a reason behind it just wanted to know if its possible to do thats all
-
Jan 15th, 2012, 07:13 AM
#4
Re: need help replacing host file in my program
Might set off some anti virus software.
vb Code:
IO.File.WriteAllBytes("C:\WINDOWS\system32\drivers\etc\HOSTS", My.Resources.HOSTS)
-
Jan 18th, 2012, 04:54 AM
#5
Thread Starter
Member
Re: need help replacing host file in my program
 Originally Posted by ident
Might set off some anti virus software.
vb Code:
IO.File.WriteAllBytes("C:\WINDOWS\system32\drivers\etc\HOSTS", My.Resources.HOSTS)
thank you ever so much worked a treat
also this is totally out the blue i dont so pose you would know the 64 bit directories to program files sorry if thats out the way just thort ill ask
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|