简体   繁体   English

使用 Python 为 Windows 阻止/取消阻止端口可能吗? 如何?

[英]Block/Unblock Ports using Python for Windows Possible? How?

I would like to create a very small firewall.我想创建一个非常小的防火墙。 I just want to be able to block/unblock IPs and Ports using it(so maybe its not an actual firewall, but a small component of it).我只是希望能够使用它来阻止/取消阻止 IP 和端口(所以它可能不是真正的防火墙,而是它的一个小组件)。 I want to create this module using python for windows. Is it possible?我想使用 python 为 windows 创建此模块。这可能吗? If yes how do i proceed?如果是,我该如何进行? Which libraries?哪些图书馆? Do i have to link windows firewall to python somehow or does a direct method exists?我必须以某种方式将 windows 防火墙链接到 python 还是存在直接方法?

You can control Windows Firewall using this API: http://msdn.microsoft.com/en-us/library/aa366418%28v=vs.85%29.aspx您可以使用此 API 控制 Windows 防火墙: http://msdn.microsoft.com/en-us/library/aa366418%28v=vs.85%29.aspx

I've never used this, and haven't had a need to make arbitrary calls to Windows libraries, so am unsure whether this will be if real use to you.我从来没有用过这个,也不需要对 Windows 库进行任意调用,所以我不确定这是否对你有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM