小编Dea*_*Joe的帖子

向防火墙添加IP-Exception

我正在研究一个项目,为此,我需要在防火墙中禁用IP地址.但是我如何在C#中做到这一点?我知道到目前为止:

public static INetFwMgr WinFirewallManager()
{
    Type type = Type.GetTypeFromCLSID(
        new Guid("{304CE942-6E39-40D8-943A-B913C40C9CD4}"));
    return Activator.CreateInstance(type) as INetFwMgr;
}
private void button1_Click(object sender, EventArgs e)
{
    INetFwMgr manager = WinFirewallManager();
    //Adding the exception to the firewall
}
Run Code Online (Sandbox Code Playgroud)

但现在我不知道如何为IP地址添加例外.

c# firewall

2
推荐指数
1
解决办法
3205
查看次数

标签 统计

c# ×1

firewall ×1