> Hi
>
[quoted text clipped - 6 lines]
> Additional information: Invalid eventID value '1296869646'. It must be
> in the range between '0' and '65535'.
I think Alphamacaroon meant to say
BitConverter.ToInt16(Guid.NewGuid().ToByteArray(), 0)
But:
> Are there any companies out there that actually write to the EventLog
> using unique EventID's?
I don't know. Bear in mind that there's a limit to how unique a value
in 0..65535 can be. Not that the above technique of taking the first
two bytes of a new GUID might not work, depending on the GUID
generation mechanism.

Signature
Larry Lard
Replies to group please
Alphamacaroon - 03 Aug 2005 23:50 GMT
Why didn't ToInt32 work? Is EventID a short? Looks like it might be.
larrylard@hotmail.com - 04 Aug 2005 14:00 GMT
> Why didn't ToInt32 work? Is EventID a short? Looks like it might be.
Actually, given that the error was
> Additional information: Invalid eventID value '1296869646'. It must be
> in the range between '0' and '65535'.
it looks like it wants a UInt16, not just an Int16 as my correction
suggested.

Signature
Larry Lard
Replies to group please
Alphamacaroon - 04 Aug 2005 21:42 GMT
I agree. If this is true, then yes I would also agree that the
uniqueness of a UInt16 is pretty spotty.