使用C#编辑主机文件 [英] Editing Hosts File with C#

查看:69
本文介绍了使用C#编辑主机文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用c#编辑主机文件,请帮帮我,因为我想为互联网上的儿童安全创建软件.

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.

推荐答案

您几乎可以打开和编辑任何文件,但是对于这种用法,它不能用于编辑主机文件.可能与安全性无关.
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.


可以做到这一点.纯文本文件的读写通过以下链接获得如何实现的想法.主机文件的路径作为参数.编辑信息并将其转储回主机.


http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx [ ^ ]
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[^]


这篇关于使用C#编辑主机文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆