Advertisement

06.10.2008 at 05:48PM PDT, ID: 23474311
[x]
Attachment Details

Obtain output from custom built Win32 service

Asked by ccovell in Microsoft Visual Basic.Net

Tags: Visual Basic, .NET 2+

I am creating a service in Visual Basic that will periodically query the status of numerous rules on an ISA 2004 firewall to determine the overall status of web browsing as well as query an exchange server performance monitor for the amount of inbound and outbound mail.  This information is going to be used on a network status page that all users can browse on an intranet.  My question is, beside writing the information to a text file, is there anyway to get information from a custom built service directly into an ASP?  I would like to avoid writing information to text file if at all possible but cannot solve this problem since my experience coding services is limited.Start Free Trial
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
[+][-]06.11.2008 at 12:54PM PDT, ID: 21763582

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 04:27PM PDT, ID: 21764986

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 08:26PM PDT, ID: 21766006

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: Visual Basic, .NET 2+
Sign Up Now!
Solution Provided By: AkisC
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.20.2008 at 05:34AM PDT, ID: 22045604

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.20.2008 at 11:22PM PDT, ID: 22048315

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 06:00PM PDT, ID: 22085143

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628