125 |
|
Alignment = 2 'Center |
126 |
|
Caption = "Status:" |
127 |
|
Height = 255 |
128 |
< |
Left = 120 |
128 |
> |
Left = 0 |
129 |
|
TabIndex = 2 |
130 |
|
Top = 1320 |
131 |
< |
Width = 4455 |
131 |
> |
Width = 4695 |
132 |
|
End |
133 |
|
End |
134 |
|
Attribute VB_Name = "Form1" |
141 |
|
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 |
142 |
|
|
143 |
|
Dim filterManagerHostname As String |
144 |
< |
Dim filterManagerTCPPort As Integer |
144 |
> |
Dim filterManagerTCPPort As Long |
145 |
|
|
146 |
|
Dim seqNo As Long |
147 |
|
Dim machineName As String |
170 |
|
'Form1.Caption = "i-scream Winhost " & protocolVersion & " for " & GetVersion() |
171 |
|
|
172 |
|
''''TEMP |
173 |
< |
filterManagerHostname = "killigrew.ukc.ac.uk" |
174 |
< |
filterManagerTCPPort = 4567 |
173 |
> |
'filterManagerHostname = "killigrew.ukc.ac.uk" |
174 |
> |
'filterManagerTCPPort = 4567 |
175 |
|
''''' END TEMP |
176 |
|
|
177 |
< |
GoTo skip |
177 |
> |
'GoTo skip |
178 |
|
On Error GoTo iniError |
179 |
|
Dim buf As String * 256 |
180 |
|
Dim length As Long |
181 |
< |
length = GetPrivateProfileString("i-scream Winhost", "FilterManager", "<no value>", buf, Len(buf), App.Path & "winhost.ini") |
181 |
> |
length = GetPrivateProfileString("i-scream Winhost", "FilterManager", "<no value>", buf, Len(buf), App.Path & "/winhost.ini") |
182 |
|
filterManagerHostname = Left$(buf, length) |
183 |
< |
length = GetPrivateProfileString("i-scream Winhost", "FilterManagerPort", "<no value>", buf, Len(buf), App.Path & "winhost.ini") |
184 |
< |
filterManagerTCPPort = Left$(buf, length) |
183 |
> |
length = GetPrivateProfileInt("i-scream Winhost", "FilterManagerPort", 0, App.Path & "/winhost.ini") |
184 |
> |
filterManagerTCPPort = length |
185 |
|
skip: |
186 |
|
|
187 |
< |
Status.Caption = "Connecting to Filter Manager" |
187 |
> |
Status.Caption = "Connecting to Filter Manager " & filterManagerHostname & ":" & filterManagerTCPPort |
188 |
|
Reconfigure_Click |
189 |
|
|
190 |
|
Form1.Show |
194 |
|
Exit Sub |
195 |
|
|
196 |
|
iniError: |
197 |
< |
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") |
197 |
> |
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") |
198 |
|
End |
199 |
|
|
200 |
|
End Sub |
402 |
|
memory& = memsts.dwAvailVirtual |
403 |
|
swapFree = memory& \ 1024 |
404 |
|
|
405 |
+ |
uptime = GetTickCount \ 1000 |
406 |
+ |
|
407 |
|
' build the contents of the XML packet |
408 |
|
xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & LocalIP & """>" & _ |
409 |
|
"<os>" & _ |
413 |
|
"<platform>" & osName & "</platform>" & _ |
414 |
|
"<minor_version>" & osVersionMinor & "</minor_version>" & _ |
415 |
|
"<processor>" & processorType & "</processor>" & _ |
416 |
+ |
"<uptime>" & uptime & "</uptime>" & _ |
417 |
|
"</os>" & _ |
418 |
|
"<memory><total>" & memTotal & "</total><free>" & memFree & "</free></memory>" & _ |
419 |
|
"<swap><total>" & swapTotal & "</total><free>" & swapFree & "</free></swap>" & _ |