For any of you who are interested, below is some VB source code that
implements the new message format. No flames from the C++ guru's or
Unix-heads please :-)

A freeware OCX from www.catalyst.com can be used with VB to access the
WinSock layer.


Dim PID As String
Dim Level As Integer
'Dim Facility As Integer
Dim Priority As Integer
Dim DateStamp As String
Dim HostAddress As String

PID = "MyProg" ' PID MUST NOT contain a space
HostAddress = Socket1.LocalAddress ' Obtain hostname from machine
Facility = 10
Level = 5

Priority = (Facility * 8) + Level

DateStamp = Format(Now, "Mmm") & " " & Right$(" " &
Mid$(Str$(Val(Format(Now, "dd"))), 2), 2) & " " & Format(Now, "hh:mm:ss")

MessageText = Left$("<" & Mid$(Str$(Priority), 2) & ">" & DateStamp & " " &
HostAddress & " " & Left$(PID, 32) & " " & MessageText, 1024)

' Send message
Socket1.Write MessageText, Len(MessageText)


Regards to all

Andrew



Reply via email to