復(fù)制代碼 代碼如下:
'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í)行以后,到
網(wǎng)上鄰居--》右鍵--》屬性--》本地連接--》常規(guī)--》Internet 協(xié)議(TCP/IP)-->屬性--》高級--》選項--》TCP/IP篩選--》屬性--》只允許 里面即可看到如下圖。

上面的代碼只是個例子,服務(wù)器上不要運行啊,如果要設(shè)置服務(wù)器,請到腳本之家服務(wù)器軟件下載中心,查看相關(guān)教材。
您可能感興趣的文章:- javascript屏蔽右鍵代碼
- jquery禁用右鍵單擊功能屏蔽F5刷新
- 屏蔽網(wǎng)頁右鍵復(fù)制和ctrl+c復(fù)制的js代碼
- 屏蔽Flash右鍵信息的js代碼
- 網(wǎng)頁屏蔽(左右鍵,代碼等)的非JS方法
- vbs之使用Internet Explorer 屏蔽密碼
- vbs屏蔽鍵盤按鍵
- VB使用XMLHTTP實現(xiàn)Post與Get的方法
- VB讀取線程、句柄及寫入內(nèi)存的API代碼實例
- VB實現(xiàn)的倒計時類代碼詳解
- VB調(diào)用Word拼寫檢查功能實例
- VB實現(xiàn)屏蔽文本框右鍵菜單的復(fù)制、粘貼等功能的方法