ServerVersion Example

 

This example displays the list of Known Servers in a list box. When a particular server is selected, the version information for that server is displayed.

Build the Server Version example as follows:

1. Create a new project and add a reference to the PISDK library.

2. Add the visual elements as shown in the picture. Make sure the numbered element names (label1, list1, ...) match those shown.

3. Cut and paste the code below into the project.

 

Option Explicit

Private Sub Form_Load()
Dim srv As Server
ClearLabels
For Each srv In Servers
  List1.AddItem srv.Name
Next
End Sub

Private Sub List1_Click()
On Error GoTo handler
  Dim srvver As ServerVersion
  Me.MousePointer = vbHourglass
  Set srvver = Servers(List1.Text).ServerVersion
  Label1.Caption = srvver.Version
  Me.MousePointer = vbDefault
  Label2.Caption = srvver.Protocol
  Label3.Caption = srvver.OSName
  Label4.Caption = srvver.OSVersion
  Label5.Caption = srvver.FileLocation
Exit Sub
handler:
  Me.MousePointer = vbDefault
  MsgBox Err.Description
End Sub
Private Sub ClearLabels()
  Label1.Caption = ""
  Label2.Caption = ""
  Label3.Caption = ""
  Label4.Caption = ""
  Label5.Caption = ""
End Sub
Enabling Operational Intelligence