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
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?
Re: need help replacing host file in my program
Quote:
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
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)
Re: need help replacing host file in my program
Quote:
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