Advertisement
Advertisement
| 06.10.2008 at 05:48PM PDT, ID: 23474311 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: |
Public Class cNetMon
Dim strCondition As String
Dim objFPC As FPCLib.FPC
Dim objFPCArrays As FPCLib.FPCArrays
Dim objFPCArray As FPCLib.FPCArray
Dim objAPRules As FPCLib.FPCPolicyRules
Dim strWebCommand As String
Dim strWebCommandA As String
Dim strWebConditionIII As String
Dim strWebAllHands As String
Dim bolWebCommand As Boolean
Dim bolWebCommandA As Boolean
Dim bolWebConditionIII As Boolean
Dim bolWebAllHands As Boolean
Protected Overrides Sub OnStart(ByVal args() As String)
strWebCommand = "Web Command"
strWebCommandA = "Web Command(A)"
strWebConditionIII = "Web Condition III"
strWebAllHands = "Web All Hands"
objFPC = CreateObject("FPC.Root")
objFPCArrays = objFPC.Arrays
objFPCArray = objFPCArrays.Connect("myISAServer")
objAPRules = objFPCArray.ArrayPolicy.PolicyRules
cnmTimer.Start()
End Sub
Protected Overrides Sub OnStop()
cnmTimer.Stop()
objAPRules = Nothing
objFPCArray = Nothing
objFPCArrays = Nothing
objFPC = Nothing
End Sub
Private Sub cnmTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cnmTimer.Tick
examinePolicy()
strCondition = webCondition()
End Sub
Private Sub examinePolicy()
Dim objRule As FPCLib.FPCPolicyRule
For Each objRule In objAPRules
If StrComp(objRule.Name, strWebCommand) = 0 Then
bolWebCommand = objRule.Enabled
ElseIf StrComp(objRule.Name, strWebCommandA) = 0 Then
bolWebCommandA = objRule.Enabled
ElseIf StrComp(objRule.Name, strWebConditionIII) = 0 Then
bolWebConditionIII = objRule.Enabled
ElseIf StrComp(objRule.Name, strWebAllHands) = 0 Then
bolWebAllHands = objRule.Enabled
End If
Next
End Sub
Function webCondition() As String
If bolWebAllHands Then
webCondition = strWebAllHands
ElseIf bolWebConditionIII Then
webCondition = strWebConditionIII
ElseIf bolWebCommand Or bolWebCommandA Then
webCondition = strWebCommand
Else
webCondition = "Secured"
End If
End Function
End Class
|