13 Years of Service
44%
Code:
>
$theNatter = ObjCreate( "HNetCfg.NATUPnP")
Dim $mappingPorts
$mappingPorts = $theNatter.StaticPortMappingCollection
If IsObj($mappingPorts) Then
;We add a new port saying that externally accept from port 1024
;Enabling the forward, and giving a name of the forward to be 'IRC'
$mappingPorts.Add (888, "TCP", 888, "192.168.30.15", True, "IRC")
MsgBox(0, "Ports added", "Suceessfull")
;To uniquely specify a forward, you give the external port
;and the protocol - here we remove the forward that we added
$mappingPorts.Remove (888, "TCP")
MsgBox(0, "Ports removed", "We're done and the total number of ports is " & $mappingPorts.Count)
Else
MsgBox(0, "Problem","Could not create a uPnP object")
EndIf