--- projects/cms/source/host/winhost/nettest.frm 2001/02/28 09:08:08 1.26 +++ projects/cms/source/host/winhost/nettest.frm 2001/03/01 09:30:55 1.32 @@ -4,7 +4,7 @@ Object = "{33155A3D-0CE0-11D1-A6B4-444553540000}#1.0#0 Begin VB.Form Form1 BorderStyle = 3 'Fixed Dialog Caption = "i-scream Winhost" - ClientHeight = 4905 + ClientHeight = 1185 ClientLeft = 45 ClientTop = 330 ClientWidth = 4710 @@ -12,7 +12,7 @@ Begin VB.Form Form1 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 4905 + ScaleHeight = 1185 ScaleWidth = 4710 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen @@ -36,12 +36,12 @@ Begin VB.Form Form1 Width = 4455 End Begin VB.CommandButton Hide - Caption = "Hide Window" - Height = 375 - Left = 3120 + Caption = "hide" + Height = 255 + Left = 3960 TabIndex = 6 - Top = 240 - Width = 1455 + Top = 480 + Width = 615 End Begin SysTray.SystemTray SystemTray Left = 2520 @@ -139,12 +139,16 @@ Dim filterManagerTCPPort As Long Dim seqNo As Long Dim machineName As String +Dim secondsRunning As Long + Dim filterHostname As String Dim filterTCPPort As Integer Dim filterUDPPort As Integer Dim fileList As String Dim lastModified As String +Dim fourtySevenDays As Integer + Dim UDPUpdateTime As Integer Dim TCPUpdateTime As Integer @@ -179,6 +183,9 @@ Private Sub Form_Load() End End If + ' Assume the host is run within the first 47 days of the machine starting. + fourtySevenDays = 0 + protocolVersion = "1.1" Status.Caption = "Loading" @@ -242,6 +249,10 @@ Private Sub Hide_Click() SystemTray.Icon = Val(Form1.Icon) End Sub +Private Sub Image1_Click() + +End Sub + Private Sub Reconfigure_Click() ' establish a TCP connection to a filtermanager connected = False @@ -283,7 +294,6 @@ Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo ' Remove linefeeds and returns from the line. response = Replace(response, Chr(13), "") response = Replace(response, Chr(10), "") - 'Text4.Text = Text4.Text & vbCrLf & response If connected = False Then ' Perform TCP configuration (1.1) @@ -299,34 +309,32 @@ Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo lastModified = response Text1.Text = Text1.Text & response & vbCrLf TCPSock.SendData "FILELIST" & vbCrLf - ''' Uncomment this for new protocol release. - 'Case 2a: - 'If response = "ERROR" Then GoTo configError - 'fileList = response - 'Text1.Text = Text1.Text & response & vbCrLf - 'TCPSock.SendData "FQDN" & vbCrLf + ' New addition to the protocol. Case 3: If response = "ERROR" Then GoTo configError fileList = response Text1.Text = Text1.Text & response & vbCrLf - ' REMOVE above line, uncomment next - 'machineName = response - TCPSock.SendData "UDPUpdateTime" & vbCrLf + TCPSock.SendData "FQDN" & vbCrLf Case 4: If response = "ERROR" Then GoTo configError + Text1.Text = Text1.Text & response & vbCrLf + machineName = response + TCPSock.SendData "UDPUpdateTime" & vbCrLf + Case 5: + If response = "ERROR" Then GoTo configError UDPUpdateTime = response Text1.Text = Text1.Text & response & vbCrLf TCPSock.SendData "TCPUpdateTime" & vbCrLf - Case 5: + Case 6: If response = "ERROR" Then GoTo configError TCPUpdateTime = response Text1.Text = Text1.Text & response & vbCrLf TCPSock.SendData "ENDCONFIG" & vbCrLf - Case 6: + Case 7: If Not response = "OK" Then GoTo configError Text1.Text = Text1.Text & response & vbCrLf TCPSock.SendData "FILTER" & vbCrLf - Case 7: + Case 8: Text1.Text = Text1.Text & response & vbCrLf 'we got a filter list here. readTo = 0 @@ -341,7 +349,7 @@ Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo ' get TCP Port number filterTCPPort = response TCPSock.SendData "END" & vbCrLf - Case 8: + Case 9: If Not response = "OK" Then GoTo configError connected = True responseNumber = 0 @@ -406,8 +414,7 @@ Private Sub Timer1_Timer() ' prepare the contents of the XML packet. seqNo = seqNo + 1 - ' Comment this line in the next protocol - machineName = TCPSock.LocalHostName + netbiosName = TCPSock.LocalHostName LocalIP = TCPSock.LocalIP packetDate = Date2Num() @@ -447,23 +454,33 @@ Private Sub Timer1_Timer() Dim memory& GlobalMemoryStatus memsts memory& = memsts.dwTotalPhys - memTotal = memory& \ 1024 + memTotal = memory& \ 1048576 memory& = memsts.dwAvailPhys - memFree = memory& \ 1024 + memFree = memory& \ 1048576 memory& = memsts.dwTotalVirtual - swapTotal = memory& \ 1024 + swapTotal = memory& \ 1048576 memory& = memsts.dwAvailVirtual - swapFree = memory& \ 1024 + swapFree = memory& \ 1048576 - uptime = CUpTime.MilliSecs \ 1000 - CUpTime.Capture cpu_time = CUpTime.CPUTime percent_idle = CUpTime.PercentIdle + '' Causes numbers to be too big :-/ + 'uptime = CUpTime.MilliSecs \ 1000 + + '' Doesn't work after 47 days :-/ + 'uptime = GetTickCount \ 1000 + + secondsRunning = secondsRunning + UDPUpdateTime + uptime = secondsRunning + + userCount = wksta.LoggedOnUsers + ' build the contents of the XML packet xml = "" & _ "" & _ + "" & netbiosName & "" & _ "" & osName & "" & _ "" & osVersionMajor & "" & _ "" & osBuild & "" & _ @@ -472,6 +489,7 @@ Private Sub Timer1_Timer() "" & processorType & "" & _ "" & uptime & "" & _ "" & _ + "" & userCount & "" & _ "" & percent_idle & "" & cpu_time & "" & _ "" & memTotal & "" & memFree & "" & _ "" & swapTotal & "" & swapFree & "" & _