如何使用 DotNet 以编程方式阻止网站
我正在开发一个 Windows 应用程序,以使用 DotNet Windows 编程来阻止计算机上的网站。我发现一些结果可以阻止 url,但不能阻止网站。也就是说我必须阻止整个网站而不是单个网址。
有人可以帮我解决这个问题吗
谢谢
Chaithanya
I am developing a windows application to block the websites from a computer using DotNet windows programming.I found some results to block an url but not for a website. That is I have to block complete website not a single url.
So can some one help me to solve this problem
Thanking You
Chaithanya
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您想要 System.Uri 类的服务 (http: //msdn.microsoft.com/en-us/library/system.uri.aspx)。我猜测在某些时候您必须决定是否允许或禁止基于 URI 的请求,在这种情况下您将需要类似于以下的逻辑:
尝试类似的东西。需要注意的是:
It sounds like you want the services of the System.Uri class (http://msdn.microsoft.com/en-us/library/system.uri.aspx). I'm guessing that at some point you have to decide whether or not you are going to allow or disallow a request based on the URI, in which case you will want logic similar to the following:
Experiment with something like that. Things to note are that:
为什么要使用在本地计算机上运行的应用程序来执行此操作?这没有多大意义。通常,这是通过公司代理完成的。
您可以编辑该
文件以将域名解析为“127.0.0.1”,而不是通常执行的操作,以阻止其以这种方式可见。但最好做得正确。
请更详细地描述您想要做什么。
Why are you using an application running on the local machine to do this? It doesn't make much sense. This is done through a corporate proxy, generally.
You may edit the
File to resolve a domain name to '127.0.0.1', instead of what it would normally do, to stop it being visible in that fashion. But it's better to do it properly.
Please describe what you're trying to do in more detail.