网址块 [英] Url Block

查看:43
本文介绍了网址块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一个程序来阻止网页浏览时的某些URL,但是我没有真正找到任何帮助。我希望在后面运行一个

服务,可以检查浏览器窗口并比较

URL,然后发布消息并关闭网页(如果匹配)。 ...任何一个

对我来说都有一个很好的起点。


TIA

Dave

解决方案

2005-02-09,Lespaul36< le ******* @ none.net>写道:

我需要编写一个程序来阻止网页浏览时的某些URL,但是我还没有真正找到任何帮助。我希望在后面运行一个
服务,可以检查浏览器窗口并比较
URL然后发布消息并关闭网页如果它匹配....任何一个
对我来说有一个很好的起点。

TIA
Dave




这听起来像代理服务器的工作或者防火墙......


使用浏览器窗口的问题是,你如何知道每个可能的浏览器的窗口......所以,你挂了IE,但是如果用户决定点火火狐(我的收藏!)或者Mozilla或者Opera或者

,那么是什么?b $ b ...不,这是唯一的办法这样做(除非你知道你将永远只用一个浏览器处理
)实际上是以上述代理形式拦截出站流量

,或者在低级别像

防火墙。低级别将涉及使用原始套接字嗅探所有出站流量,并且您可能更容易在C#VB.NET中执行

。 。


如果您知道它总是一个浏览器,那么您可能需要

需要做一个系统范围的钩子来接收所有消息与创建顶级窗口相关的

...可能WH_SHELL将是最好的

选择,因为它只会向您发送最高级别的通知

窗口,而不是系统中的每个对话框,按钮和菜单。但是,

这意味着你必须走出.NET以外的

实际钩子,因为这种钩子必须位于标准的非com

dll。


是否有一些原因导致您无法使用众多可用的

解决方案中的一种?


-

Tom Shelton [MVP]


Tom,


我很高兴你用这种方式写这个,上次我很害怕

回答这类消息,因为我看过很多关于
的消息b $ b端口并且如果没有找到方法则有疑问。


你知道我总是在上下文中回答这个问题的方式和你做的完全相同

现在。


Cor


这是我的侄子...他已经进入了一点点麻烦并且是因为他的电脑使用限制了b $ b。在过去,我曾尝试过一些

育儿产品,但他们完成了它然后我似乎无法将b / b
移除它们,是一个真的很痛苦但是。


他使用IE而且他不能安装软件。我认为有一种方法可以使用安全策略来阻止
块网站,但是还没有找到很多关于它的b
。我以为甚至可能有一种方法可以用IE本身来做,

但没有运气。


我有兴趣了解程序如何这对我来说也是有用的。至于在C#中更容易,不是全部.net

语言对CLR具有相同的访问权限。我知道c#,但我更喜欢用bb来舒服。

" Tom Shelton" < TS ****** @ YOUKNOWTHEDRILLcomcast.net>在留言中写道

news:uD ************* @ TK2MSFTNGP14.phx.gbl ...

On 2005-02-09 ,Lespaul36< le ******* @ none.net>写道:

我需要编写一个程序来阻止网页浏览时的某些URL,但是我还没有真正找到任何帮助。我希望在后面运行
服务,可以检查浏览器窗口并比较
URL,然后发布消息,如果匹配则关闭网页。 ......任何一个
对我来说都有一个很好的起点。

TIA
戴夫



这听起来像代理服务器或防火墙的工作...

使用浏览器窗口的问题是,你如何知道每个可能的浏览器的窗口...所以,你挂了IE,但是如果用户决定启动Firefox(我的收藏!)或Mozilla或Opera或
......那么,这是唯一的方法(除非你知道你会总是
只处理一个浏览器)真的是以上面所述的代理形式拦截出站流量,或者像防火墙一样在低层。低级别将涉及使用原始套接字来嗅探所有出站流量,并且您可能更容易在C#中使用VB.NET ...
如果你知道它总是一个浏览器,那么你可能需要做一个系统范围的钩子来接收与创建顶级窗口相关的所有消息......可能WH_SHELL将是最好的选择,因为它只会向您发送顶级窗口的通知,而不会发送给系统中的每个对话框,按钮和菜单。但是,
这意味着你必须走出.NET才能获得实际的钩子,因为这种钩子必须位于一个标准的非com
dll中。

你有什么理由不能使用众多可用的解决方案吗?

- 汤姆谢尔顿[MVP]



I need to write a program to block certain URLs when web browsing, but I
have not been able to really find anything to help. I was hoping to have a
service running in the back that can check browser windows and compare the
URLs then post a message and shut down the web page if it matches....Any one
have a good starting point for me.

TIA
Dave

解决方案

On 2005-02-09, Lespaul36 <le*******@none.net> wrote:

I need to write a program to block certain URLs when web browsing, but I
have not been able to really find anything to help. I was hoping to have a
service running in the back that can check browser windows and compare the
URLs then post a message and shut down the web page if it matches....Any one
have a good starting point for me.

TIA
Dave



That sounds like the job of a proxy server or a firewall...

The problem with using browser windows is that, how are you going to
know the window for every possible browser... So, you hook IE, but what
if the user decides to fire up Firefox (my fav!) or Mozilla or Opera or
.... No, the only way to do this (unless you know that you will always
be dealing with only one browser) is really to intercept outbound traffic
in the form of a proxy as stated above, or on the low level like a
firewall. The low level would involve the use of raw sockets to sniff
all outbound traffic, and you would probably have an easier time doing
that in C# the VB.NET...

If you know it''s always going to be one browser, then you would probably
need to do a system wide hook to recieve all messages related to the
creating of top level windows... Probably WH_SHELL would be the best
choice, since it would only send you notifications for top level
windows, and not for every dialog, button, and menu in the system. But,
that would mean that you would have to step outside of .NET for the
actual hook since this kind of hook must reside in a standard non-com
dll.

Is there some reason that you can''t use one of the many available
solutions to this?

--
Tom Shelton [MVP]


Tom,

I am glad you write about this in this way, the last time I was scared to
answer this kind of messages because of the lot of messages I had seen about
ports and was in doubt if there was not found a method for this.

You know that I answer this always in context wise exact same way as you did
now.

Cor


It is for my nephew...he has been getting in a bit of trouble and is
restricted on his computer use. In the past I have tried a few of the
parenting products out there, but they over did it and then I couldn''t seem
to remove them, was a real pain in the but.

He uses IE and he can''t install software. I thought there was a way to
block sites using Security Policies, but haven''t been able to find much out
about it. I was thinking there might even be a way to do it with IE itself,
but no luck.

I was interested in finding out how a program like that would work also to
further my knowledge. As far as being easier in C#, don''t all .net
languages have the same access to the CLR. I do know c#, but I am more
comfortable with vb.
"Tom Shelton" <ts******@YOUKNOWTHEDRILLcomcast.net> wrote in message
news:uD*************@TK2MSFTNGP14.phx.gbl...

On 2005-02-09, Lespaul36 <le*******@none.net> wrote:

I need to write a program to block certain URLs when web browsing, but I
have not been able to really find anything to help. I was hoping to have
a
service running in the back that can check browser windows and compare
the
URLs then post a message and shut down the web page if it matches....Any
one
have a good starting point for me.

TIA
Dave



That sounds like the job of a proxy server or a firewall...

The problem with using browser windows is that, how are you going to
know the window for every possible browser... So, you hook IE, but what
if the user decides to fire up Firefox (my fav!) or Mozilla or Opera or
... No, the only way to do this (unless you know that you will always
be dealing with only one browser) is really to intercept outbound traffic
in the form of a proxy as stated above, or on the low level like a
firewall. The low level would involve the use of raw sockets to sniff
all outbound traffic, and you would probably have an easier time doing
that in C# the VB.NET...

If you know it''s always going to be one browser, then you would probably
need to do a system wide hook to recieve all messages related to the
creating of top level windows... Probably WH_SHELL would be the best
choice, since it would only send you notifications for top level
windows, and not for every dialog, button, and menu in the system. But,
that would mean that you would have to step outside of .NET for the
actual hook since this kind of hook must reside in a standard non-com
dll.

Is there some reason that you can''t use one of the many available
solutions to this?

--
Tom Shelton [MVP]



这篇关于网址块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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