復制代碼 代碼如下:
'On Error Resume Next
Const ALLOW_ALL = 0
Port = Array("4900", "5000", "5100", "5500", "5600", "6000", "7000", "7100", "7200", "7300", "7400","3389","80")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" strComputer "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard In colNetCards
arrPermittedTCPPorts = Port
arrPermittedUDPPorts = Array(ALLOW_ALL)
arrPermittedIPProtocols = Array(ALLOW_ALL)
objNetCard.EnableIPSec arrPermittedTCPPorts, arrPermittedUDPPorts, arrPermittedIPProtocols
Next
執(zhí)行以后,到
網上鄰居--》右鍵--》屬性--》本地連接--》常規(guī)--》Internet 協(xié)議(TCP/IP)-->屬性--》高級--》選項--》TCP/IP篩選--》屬性--》只允許 里面即可看到如下圖。
![](/upload/2010-4/20100417115158720.gif)
上面的代碼只是個例子,服務器上不要運行啊,如果要設置服務器,請到腳本之家服務器軟件下載中心,查看相關教材。
您可能感興趣的文章:- javascript屏蔽右鍵代碼
- jquery禁用右鍵單擊功能屏蔽F5刷新
- 屏蔽網頁右鍵復制和ctrl+c復制的js代碼
- 屏蔽Flash右鍵信息的js代碼
- 網頁屏蔽(左右鍵,代碼等)的非JS方法
- vbs之使用Internet Explorer 屏蔽密碼
- vbs屏蔽鍵盤按鍵
- VB使用XMLHTTP實現(xiàn)Post與Get的方法
- VB讀取線程、句柄及寫入內存的API代碼實例
- VB實現(xiàn)的倒計時類代碼詳解
- VB調用Word拼寫檢查功能實例
- VB實現(xiàn)屏蔽文本框右鍵菜單的復制、粘貼等功能的方法