我需要为我的应用程序打开特定端口.
我已尝试INetFwAuthorizedApplication为所有端口使用每个应用程序的规则.
fwMgr.LocalPolicy.CurrentProfile.AuthorizedApplications.Add(app)
Run Code Online (Sandbox Code Playgroud)
或者,为所有应用程序打开一个端口INetFwOpenPort.
firewallManager.LocalPolicy.CurrentProfile.GloballyOpenPorts.Add(port)
Run Code Online (Sandbox Code Playgroud)
有没有办法以编程方式以编程方式为每个应用程序打开单个端口?我可以通过防火墙设置手动完成.