| 8 |
|
ClientLeft = 45 |
| 9 |
|
ClientTop = 330 |
| 10 |
|
ClientWidth = 4710 |
| 11 |
+ |
Icon = "nettest.frx":0000 |
| 12 |
|
LinkTopic = "Form1" |
| 13 |
|
MaxButton = 0 'False |
| 14 |
|
MinButton = 0 'False |
| 42 |
|
MultiLine = -1 'True |
| 43 |
|
ScrollBars = 2 'Vertical |
| 44 |
|
TabIndex = 1 |
| 45 |
< |
Text = "nettest.frx":0000 |
| 45 |
> |
Text = "nettest.frx":0742 |
| 46 |
|
Top = 3000 |
| 47 |
|
Width = 3975 |
| 48 |
|
End |
| 126 |
|
Alignment = 2 'Center |
| 127 |
|
Caption = "Status:" |
| 128 |
|
Height = 255 |
| 129 |
< |
Left = 120 |
| 129 |
> |
Left = 0 |
| 130 |
|
TabIndex = 2 |
| 131 |
|
Top = 1320 |
| 132 |
< |
Width = 4455 |
| 132 |
> |
Width = 4695 |
| 133 |
|
End |
| 134 |
|
End |
| 135 |
|
Attribute VB_Name = "Form1" |
| 142 |
|
Private Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long |
| 143 |
|
|
| 144 |
|
Dim filterManagerHostname As String |
| 145 |
< |
Dim filterManagerTCPPort As Integer |
| 145 |
> |
Dim filterManagerTCPPort As Long |
| 146 |
|
|
| 147 |
|
Dim seqNo As Long |
| 148 |
|
Dim machineName As String |
| 159 |
|
Dim protocolVersion As String |
| 160 |
|
Dim connected As Boolean |
| 161 |
|
|
| 162 |
< |
'Dim CUpTime As New CUpTime |
| 162 |
> |
Dim CUpTime As New CUpTime |
| 163 |
|
|
| 164 |
|
Dim responseNumber As Integer |
| 165 |
|
|
| 168 |
|
protocolVersion = "1.1" |
| 169 |
|
|
| 170 |
|
Status.Caption = "Loading" |
| 171 |
< |
'Form1.Caption = "i-scream Winhost " & protocolVersion & " for " & GetVersion() |
| 171 |
> |
Form1.Caption = "i-scream Winhost " & protocolVersion |
| 172 |
|
|
| 173 |
+ |
Form1.Show |
| 174 |
+ |
|
| 175 |
+ |
CUpTime.Init |
| 176 |
+ |
|
| 177 |
+ |
If CUpTime.isWin9x Then |
| 178 |
+ |
x = MsgBox("Sorry, the i-scream host can only be used to monitor servers (i.e. not Win9x)", 48, "Not a server.") |
| 179 |
+ |
End |
| 180 |
+ |
End If |
| 181 |
+ |
|
| 182 |
|
''''TEMP |
| 183 |
< |
filterManagerHostname = "killigrew.ukc.ac.uk" |
| 184 |
< |
filterManagerTCPPort = 4567 |
| 183 |
> |
'filterManagerHostname = "killigrew.ukc.ac.uk" |
| 184 |
> |
'filterManagerTCPPort = 4567 |
| 185 |
|
''''' END TEMP |
| 186 |
|
|
| 187 |
< |
GoTo skip |
| 187 |
> |
'GoTo skip |
| 188 |
|
On Error GoTo iniError |
| 189 |
|
Dim buf As String * 256 |
| 190 |
|
Dim length As Long |
| 191 |
< |
length = GetPrivateProfileString("i-scream Winhost", "FilterManager", "<no value>", buf, Len(buf), App.Path & "winhost.ini") |
| 191 |
> |
length = GetPrivateProfileString("i-scream Winhost", "FilterManager", "<no value>", buf, Len(buf), App.Path & "/winhost.ini") |
| 192 |
|
filterManagerHostname = Left$(buf, length) |
| 193 |
< |
length = GetPrivateProfileString("i-scream Winhost", "FilterManagerPort", "<no value>", buf, Len(buf), App.Path & "winhost.ini") |
| 194 |
< |
filterManagerTCPPort = Left$(buf, length) |
| 193 |
> |
length = GetPrivateProfileInt("i-scream Winhost", "FilterManagerPort", 0, App.Path & "/winhost.ini") |
| 194 |
> |
filterManagerTCPPort = length |
| 195 |
> |
On Error GoTo 0 |
| 196 |
|
skip: |
| 197 |
|
|
| 198 |
< |
Status.Caption = "Connecting to Filter Manager" |
| 198 |
> |
Status.Caption = "Connecting to Filter Manager " & filterManagerHostname & ":" & filterManagerTCPPort |
| 199 |
|
Reconfigure_Click |
| 200 |
|
|
| 201 |
< |
Form1.Show |
| 201 |
> |
SystemTray.Icon = Val(Form1.Icon) |
| 202 |
|
SystemTray.Action = 0 |
| 203 |
|
|
| 204 |
|
|
| 205 |
|
Exit Sub |
| 206 |
|
|
| 207 |
|
iniError: |
| 208 |
< |
x = MsgBox("The i-scream Winhost could not read the correct settings from the winhost.ini file. Please correct these and try again.", 48, "Configuration not found") |
| 208 |
> |
x = MsgBox("The i-scream Winhost could not read the correct settings from the winhost.ini file. Please correct these and try again. " & Err.Description, 48, "Configuration not found") |
| 209 |
|
End |
| 210 |
|
|
| 211 |
|
End Sub |
| 379 |
|
End |
| 380 |
|
End If |
| 381 |
|
|
| 382 |
< |
osName = getVersion() |
| 382 |
> |
osName = GetVersion() |
| 383 |
|
osVersionMajor = verinfo.dwMajorVersion |
| 384 |
|
osVersionMinor = verinfo.dwMinorVersion |
| 385 |
|
osBuild = verinfo.dwBuildNumber |
| 413 |
|
memory& = memsts.dwAvailVirtual |
| 414 |
|
swapFree = memory& \ 1024 |
| 415 |
|
|
| 416 |
+ |
uptime = GetTickCount \ 1000 |
| 417 |
+ |
|
| 418 |
|
' build the contents of the XML packet |
| 419 |
|
xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & LocalIP & """>" & _ |
| 420 |
|
"<os>" & _ |
| 424 |
|
"<platform>" & osName & "</platform>" & _ |
| 425 |
|
"<minor_version>" & osVersionMinor & "</minor_version>" & _ |
| 426 |
|
"<processor>" & processorType & "</processor>" & _ |
| 427 |
+ |
"<uptime>" & uptime & "</uptime>" & _ |
| 428 |
|
"</os>" & _ |
| 429 |
|
"<memory><total>" & memTotal & "</total><free>" & memFree & "</free></memory>" & _ |
| 430 |
|
"<swap><total>" & swapTotal & "</total><free>" & swapFree & "</free></swap>" & _ |