Click here to Skip to main content
16,019,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is it possible to edit hosts file with c#.Please help me , because I want to create a software for children's safety in the internet.If there was any prblem in writing English , this happens because I can't speak English well.
Posted

You can open and edit just about any file but for this usage it wouldn't serve any purpose to edit the host file. It has nothing to do with security.
 
Share this answer
 
It is possible to do so.It is plain text file reading and writing go through the following link to get an idea on how to do so.Pass path of the host file as a parameter.Edit the information and dump it back to the host.


http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx[^]
 
Share this answer
 
Comments
S@53K^S 16-Apr-12 10:14am    
reason for downvoting ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900