VB.NET阻止.exe访问互联网的简单方法
有没有一种简单的方法可以做到这一点,而无需编写完整的应用程序级防火墙或使用 Windows 防火墙?
我发现这非常有趣: Winsock Injector 它禁止对选定进程使用 Windows 套接字 (winsock)。
这样的注入器可以在 VB.NET 中完成吗?它适用于所有情况吗?
我尝试了注射器,但它似乎不适用于某些应用程序,
谢谢
Is there a simple way to do this without having to programme a complete application level firewall or using Windows firewall?
I found this very interesting: Winsock Injector
It disables the use of Windows Sockets (winsock) for selected processes.
Can such an injector be done in VB.NET and does it work for everything?
I tried the injector but it doesnt seem to work for certain applications
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用代码访问安全性来防止这种情况。每个.NET Framework版本的实现有所不同,但应该有类似的方法。
http://msdn.microsoft.com/ en-us/library/4b7hy971%28v=vs.85%29.aspx
这是 WebBrowserPermission 属性的帮助文档。
http:// msdn.microsoft.com/en-us/library/system.security.permissions.webbrowserpermission%28v=vs.85%29.aspx
根据您的编辑,上述内容将不起作用。
您想要阻止计算机访问互联网,而不是阻止您正在编写的应用程序。
在这种情况下,阻止互联网访问的最简单的暴力方法是禁用网络连接本身。有关如何执行此操作的示例,请参阅此问题。
You could probably use Code Access Security to prevent this. The implementations for each .NET Framework versions vary, but there should be a way similar to this.
http://msdn.microsoft.com/en-us/library/4b7hy971%28v=vs.85%29.aspx
Here is the help doc for the WebBrowserPermission attribute.
http://msdn.microsoft.com/en-us/library/system.security.permissions.webbrowserpermission%28v=vs.85%29.aspx
Based on your edits, the above won't work.
You want to block the COMPUTER's access to the internet, not the application you are writing.
The easiest brute force method to block internet access in this case would be to disable the Network Connection itself. For an example how to do this, see this question.