如何使用 Delphi 断开任何进程与 Internet 的连接?
如何断开任何进程与 Internet 的连接? PID 进程和 IP(本地/远程)已知。
How can I disconnect any process from the Internet? PID process and IP (local / remote) are known.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您想控制哪些应用程序可以访问网络/互联网。
如果您只想选择哪些应用程序可以访问网络或您想要使用哪些协议,我推荐任何免费或商业防火墙产品。
如果您需要更多控制,例如断开给定进程/协议的现有连接,我不知道简单的 API 调用。这意味着需要付出更多的努力,但您可以使用用 Delphi 编写的本地代理服务器。如果应用程序使用此代理来访问外部世界,您可以添加断开特定连接的功能。
It sounds like you want to control which applications can access the network/Internet.
If you just want to pick and choose which applications can have network access or which protocols you want to be used, I recommend any free or commercial firewall product.
If you need more control, such as disconnecting existing connections for a given process/protocol, I don't know of a simple API call. It would mean more effort, but you could use a local proxy server written in Delphi. If applications use this proxy to get to the outside world, you can add the ability to disconnect specific connections.
您可以终止进程本身,或者断开网卡与网络的连接(尽管后者会影响计算机上的所有进程)。 AFIK 最新的软件防火墙不允许仅在请求新连接时对现有连接应用规则更改。
You could kill the process itself, or disconnect the network card from the network (the later would effect all processes on the machine though). AFIK most current software firewalls do not allow apply rule changes to existing connections, just when new connections are requested.