找回密碼
 註冊
搜索
查看: 7882|回復: 1

C# Windows Firewall 控制

[複製鏈接]
發表於 2011-8-12 15:54:34 | 顯示全部樓層 |閱讀模式
Automating Windows Firewall Settings with C#
http://blogs.msdn.com/b/security ... ettings-with-c.aspx

在Vista中編程控制防火牆設定(C#)
http://www.cnblogs.com/phytan/archive/2009/01/20/814474.html

C#實現修改ip地址(呼叫netsh修改,因此可拿來控制Firewall)
http://www.7es.cn/Software_development/174.shtml

Windows Firewall Tools and Settings (netsh firewall 操作指令)
http://technet.microsoft.com/en-us/library/cc737845%28WS.10%29.aspx

Netsh Commands for Windows Firewall (for XP)
http://technet.microsoft.com/en-us/library/cc771046(WS.10).aspx

Netsh AdvFirewall Firewall Commands (for Vista/Win7/Win2008)
http://technet.microsoft.com/en-us/library/dd734783(WS.10).aspx



 樓主| 發表於 2011-9-23 14:07:37 | 顯示全部樓層
新增防火牆Rule
netsh advfirewall firewall add rule name="kms1" protocol=tcp dir=in localport=1688 action=allow remoteip=10.10.10.10
修改kms1 Rule的遠端IP
netsh advfirewall firewall set rule name="kms1" new remoteip=192.168.0.0/24,192.168.1.1/32,192.168.2.1-192.168.2.10刪除防火牆Rule
netsh advfirewall firewall delete rule name="kms1"
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-11-21 16:52 , Processed in 0.019264 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表