2 |
|
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX" |
3 |
|
Object = "{33155A3D-0CE0-11D1-A6B4-444553540000}#1.0#0"; "SysTray.ocx" |
4 |
|
Begin VB.Form Form1 |
5 |
< |
BorderStyle = 4 'Fixed ToolWindow |
5 |
> |
BorderStyle = 3 'Fixed Dialog |
6 |
|
Caption = "i-scream Winhost" |
7 |
|
ClientHeight = 5655 |
8 |
|
ClientLeft = 45 |
9 |
< |
ClientTop = 285 |
9 |
> |
ClientTop = 330 |
10 |
|
ClientWidth = 4710 |
11 |
|
LinkTopic = "Form1" |
12 |
|
MaxButton = 0 'False |
13 |
+ |
MinButton = 0 'False |
14 |
|
ScaleHeight = 5655 |
15 |
|
ScaleWidth = 4710 |
16 |
|
ShowInTaskbar = 0 'False |
68 |
|
_Version = 393216 |
69 |
|
Protocol = 1 |
70 |
|
End |
71 |
+ |
Begin VB.Label Label5 |
72 |
+ |
Caption = "b e t a" |
73 |
+ |
BeginProperty Font |
74 |
+ |
Name = "MS Sans Serif" |
75 |
+ |
Size = 24 |
76 |
+ |
Charset = 0 |
77 |
+ |
Weight = 700 |
78 |
+ |
Underline = 0 'False |
79 |
+ |
Italic = 0 'False |
80 |
+ |
Strikethrough = 0 'False |
81 |
+ |
EndProperty |
82 |
+ |
Height = 615 |
83 |
+ |
Left = 240 |
84 |
+ |
TabIndex = 8 |
85 |
+ |
Top = 120 |
86 |
+ |
Width = 1815 |
87 |
+ |
End |
88 |
|
Begin VB.Label Label2 |
89 |
|
Alignment = 1 'Right Justify |
90 |
|
Caption = "Next heartbeat:" |
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 |
157 |
|
|
158 |
|
Dim protocolVersion As String |
159 |
|
Dim connected As Boolean |
160 |
+ |
|
161 |
+ |
'Dim CUpTime As New CUpTime |
162 |
+ |
|
163 |
|
Dim responseNumber As Integer |
164 |
|
|
165 |
|
Private Sub Form_Load() |
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 |
356 |
|
' prepare the contents of the XML packet. |
357 |
|
seqNo = seqNo + 1 |
358 |
|
machineName = TCPSock.LocalHostName |
359 |
< |
localIP = TCPSock.localIP |
359 |
> |
LocalIP = TCPSock.LocalIP |
360 |
|
packetDate = Date2Num() |
361 |
|
|
362 |
|
|
403 |
|
swapFree = memory& \ 1024 |
404 |
|
|
405 |
|
' build the contents of the XML packet |
406 |
< |
xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & localIP & """>" & _ |
406 |
> |
xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & LocalIP & """>" & _ |
407 |
|
"<os>" & _ |
408 |
|
"<name>" & osName & "</name>" & _ |
409 |
|
"<version>" & osVersionMajor & "</version>" & _ |
414 |
|
"</os>" & _ |
415 |
|
"<memory><total>" & memTotal & "</total><free>" & memFree & "</free></memory>" & _ |
416 |
|
"<swap><total>" & swapTotal & "</total><free>" & swapFree & "</free></swap>" & _ |
417 |
< |
"" |
417 |
> |
"</packet>" |
418 |
|
Text4.Text = Text4.Text + xml |
419 |
|
|
420 |
|
' Use the first winsock control to send a UDP packet. |