| 4 |
|
Begin VB.Form Form1 |
| 5 |
|
BorderStyle = 3 'Fixed Dialog |
| 6 |
|
Caption = "i-scream Winhost" |
| 7 |
< |
ClientHeight = 4905 |
| 7 |
> |
ClientHeight = 1185 |
| 8 |
|
ClientLeft = 45 |
| 9 |
|
ClientTop = 330 |
| 10 |
|
ClientWidth = 4710 |
| 12 |
|
LinkTopic = "Form1" |
| 13 |
|
MaxButton = 0 'False |
| 14 |
|
MinButton = 0 'False |
| 15 |
< |
ScaleHeight = 4905 |
| 15 |
> |
ScaleHeight = 1185 |
| 16 |
|
ScaleWidth = 4710 |
| 17 |
|
ShowInTaskbar = 0 'False |
| 18 |
|
StartUpPosition = 2 'CenterScreen |
| 36 |
|
Width = 4455 |
| 37 |
|
End |
| 38 |
|
Begin VB.CommandButton Hide |
| 39 |
< |
Caption = "Hide Window" |
| 40 |
< |
Height = 375 |
| 41 |
< |
Left = 3120 |
| 39 |
> |
Caption = "hide" |
| 40 |
> |
Height = 255 |
| 41 |
> |
Left = 3960 |
| 42 |
|
TabIndex = 6 |
| 43 |
< |
Top = 240 |
| 44 |
< |
Width = 1455 |
| 43 |
> |
Top = 480 |
| 44 |
> |
Width = 615 |
| 45 |
|
End |
| 46 |
|
Begin SysTray.SystemTray SystemTray |
| 47 |
|
Left = 2520 |
| 242 |
|
SystemTray.Icon = Val(Form1.Icon) |
| 243 |
|
End Sub |
| 244 |
|
|
| 245 |
+ |
Private Sub Image1_Click() |
| 246 |
+ |
|
| 247 |
+ |
End Sub |
| 248 |
+ |
|
| 249 |
|
Private Sub Reconfigure_Click() |
| 250 |
|
' establish a TCP connection to a filtermanager |
| 251 |
|
connected = False |
| 287 |
|
' Remove linefeeds and returns from the line. |
| 288 |
|
response = Replace(response, Chr(13), "") |
| 289 |
|
response = Replace(response, Chr(10), "") |
| 286 |
– |
'Text4.Text = Text4.Text & vbCrLf & response |
| 290 |
|
|
| 291 |
|
If connected = False Then |
| 292 |
|
' Perform TCP configuration (1.1) |
| 302 |
|
lastModified = response |
| 303 |
|
Text1.Text = Text1.Text & response & vbCrLf |
| 304 |
|
TCPSock.SendData "FILELIST" & vbCrLf |
| 305 |
< |
''' Uncomment this for new protocol release. |
| 303 |
< |
'Case 2a: |
| 304 |
< |
'If response = "ERROR" Then GoTo configError |
| 305 |
< |
'fileList = response |
| 306 |
< |
'Text1.Text = Text1.Text & response & vbCrLf |
| 307 |
< |
'TCPSock.SendData "FQDN" & vbCrLf |
| 305 |
> |
' New addition to the protocol. |
| 306 |
|
Case 3: |
| 307 |
|
If response = "ERROR" Then GoTo configError |
| 308 |
|
fileList = response |
| 309 |
|
Text1.Text = Text1.Text & response & vbCrLf |
| 310 |
< |
' REMOVE above line, uncomment next |
| 313 |
< |
'machineName = response |
| 314 |
< |
TCPSock.SendData "UDPUpdateTime" & vbCrLf |
| 310 |
> |
TCPSock.SendData "FQDN" & vbCrLf |
| 311 |
|
Case 4: |
| 312 |
|
If response = "ERROR" Then GoTo configError |
| 313 |
+ |
Text1.Text = Text1.Text & response & vbCrLf |
| 314 |
+ |
machineName = response |
| 315 |
+ |
TCPSock.SendData "UDPUpdateTime" & vbCrLf |
| 316 |
+ |
Case 5: |
| 317 |
+ |
If response = "ERROR" Then GoTo configError |
| 318 |
|
UDPUpdateTime = response |
| 319 |
|
Text1.Text = Text1.Text & response & vbCrLf |
| 320 |
|
TCPSock.SendData "TCPUpdateTime" & vbCrLf |
| 321 |
< |
Case 5: |
| 321 |
> |
Case 6: |
| 322 |
|
If response = "ERROR" Then GoTo configError |
| 323 |
|
TCPUpdateTime = response |
| 324 |
|
Text1.Text = Text1.Text & response & vbCrLf |
| 325 |
|
TCPSock.SendData "ENDCONFIG" & vbCrLf |
| 326 |
< |
Case 6: |
| 326 |
> |
Case 7: |
| 327 |
|
If Not response = "OK" Then GoTo configError |
| 328 |
|
Text1.Text = Text1.Text & response & vbCrLf |
| 329 |
|
TCPSock.SendData "FILTER" & vbCrLf |
| 330 |
< |
Case 7: |
| 330 |
> |
Case 8: |
| 331 |
|
Text1.Text = Text1.Text & response & vbCrLf |
| 332 |
|
'we got a filter list here. |
| 333 |
|
readTo = 0 |
| 342 |
|
' get TCP Port number |
| 343 |
|
filterTCPPort = response |
| 344 |
|
TCPSock.SendData "END" & vbCrLf |
| 345 |
< |
Case 8: |
| 345 |
> |
Case 9: |
| 346 |
|
If Not response = "OK" Then GoTo configError |
| 347 |
|
connected = True |
| 348 |
|
responseNumber = 0 |
| 407 |
|
' prepare the contents of the XML packet. |
| 408 |
|
seqNo = seqNo + 1 |
| 409 |
|
|
| 410 |
< |
' Comment this line in the next protocol |
| 410 |
< |
machineName = TCPSock.LocalHostName |
| 410 |
> |
netbiosName = TCPSock.LocalHostName |
| 411 |
|
|
| 412 |
|
LocalIP = TCPSock.LocalIP |
| 413 |
|
packetDate = Date2Num() |
| 447 |
|
Dim memory& |
| 448 |
|
GlobalMemoryStatus memsts |
| 449 |
|
memory& = memsts.dwTotalPhys |
| 450 |
< |
memTotal = memory& \ 1024 |
| 450 |
> |
memTotal = memory& \ 1048576 |
| 451 |
|
memory& = memsts.dwAvailPhys |
| 452 |
< |
memFree = memory& \ 1024 |
| 452 |
> |
memFree = memory& \ 1048576 |
| 453 |
|
memory& = memsts.dwTotalVirtual |
| 454 |
< |
swapTotal = memory& \ 1024 |
| 454 |
> |
swapTotal = memory& \ 1048576 |
| 455 |
|
memory& = memsts.dwAvailVirtual |
| 456 |
< |
swapFree = memory& \ 1024 |
| 456 |
> |
swapFree = memory& \ 1048576 |
| 457 |
|
|
| 458 |
|
uptime = CUpTime.MilliSecs \ 1000 |
| 459 |
|
|
| 461 |
|
cpu_time = CUpTime.CPUTime |
| 462 |
|
percent_idle = CUpTime.PercentIdle |
| 463 |
|
|
| 464 |
+ |
userCount = wksta.LoggedOnUsers |
| 465 |
+ |
|
| 466 |
|
' build the contents of the XML packet |
| 467 |
|
xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & LocalIP & """>" & _ |
| 468 |
|
"<os>" & _ |
| 469 |
+ |
"<netbios_name>" & netbiosName & "</netbios_name>" & _ |
| 470 |
|
"<name>" & osName & "</name>" & _ |
| 471 |
|
"<version>" & osVersionMajor & "</version>" & _ |
| 472 |
|
"<release>" & osBuild & "</release>" & _ |
| 475 |
|
"<processor>" & processorType & "</processor>" & _ |
| 476 |
|
"<uptime>" & uptime & "</uptime>" & _ |
| 477 |
|
"</os>" & _ |
| 478 |
+ |
"<users><count>" & userCount & "</count></users>" & _ |
| 479 |
|
"<cpu><idle>" & percent_idle & "</idle><user>" & cpu_time & "</user></cpu>" & _ |
| 480 |
|
"<memory><total>" & memTotal & "</total><free>" & memFree & "</free></memory>" & _ |
| 481 |
|
"<swap><total>" & swapTotal & "</total><free>" & swapFree & "</free></swap>" & _ |