Rules



With Rules object you can access to count of rules, indexes of each rule and it's other properties. Also you can obtain Rule objects from this object.

 

Example:

 

'netcom.dll contains 'NetCom.Remote' object.

Set Remote = CreateObject("NetCom.Remote")

 

With Remote

       .Host = "192.168.0.1"

       .Port = 42566

       .UserName = "Administrator"

       .Password = "mypass"

       'Connect and query remote TrafficFilter object

       Set TrafficFilter = .CreateRoot

End With

 

Set Rules = TrafficFilter.Rules

With Rules

 

       'Add new rule as first in list

       .Insert 0, "MyNewRule"

 

       'Force configuration saving (normally configuration saved every 3 minutes automatically)

       TrafficFilter.ForceSaveConfig

 

       'Find new added rule

       Set Rule = .FindByName("MyNewRule")

 

       WScript.Echo "Added new rule with name " & Rule.Name

 

End With

 

Set TrafficFilter = Nothing

Remote.Disconnect

Set Remote = Nothing

 

WScript.Echo vbCrLf & "Press any key..."

WScript.StdIn.Read(1)