Anyone used VFP to read the windows event log?
Anyone used VFP to read the windows event log?
(OP)
I am looking at reading the event log to look for possible 'probes' and update the firewall rules automatically
Anyone done this already?
Anyone done this already?
Regards
Griff
Keep ing
There are 10 kinds of people in the world, those who understand binary and those who don't.
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
I haven’t done so.
Perhaps exporting the event logs with PowerShell is a good starting point?
https://help.altaro.com/hc/en-us/articles/44169217...
Regards, Gerrit
RE: Anyone used VFP to read the windows event log?
I found this article https://github.com/VFPX/Win32API/blob/master/sampl...
It ought to be possible to read the log from within VFP, without exporting the logs... but if I can't
get my head round it...
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
CODE
But I don't think this is intended to read one of the standard logs, but one you make yourself, for your own application.
Chriss
RE: Anyone used VFP to read the windows event log?
The link I found actually works, albeit it is hardly the two line answer you've given!
It is a slow process though.
I claim no ownership or authorship of the code below, 99.99% taken from the github link
above and dropped into a single .prg
CODE
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
it is really beyond me, how you cannot see this.
my usage exameple is using the class definition you liknked to. Yes, OF COURSE, you have to first establish this whole class from the link you've given.
Here's how the code starts, Griff:
CODE -->
And there is no usage example, it's just a class definition. What do you do with a class, Griff? You do a CREATEOBJECT, and then you call methods.
My short code needs this class definition, it's just the usage example, Griff, but it's all you need additionally to the class definiiotn. Is that clearer, now?
Chriss
RE: Anyone used VFP to read the windows event log?
I did not realise your example was using the class in the link...
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
my code:
CODE
o = CreateObject("WindowsEventLog",...
class definition:
CODE
DEFINE CLASS WindowsEventLog As Session
Do I really need to point out my few lines need this class definition?
Chriss
RE: Anyone used VFP to read the windows event log?
I hadn't even read the class definition when I posted my link!
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
RE: Anyone used VFP to read the windows event log?
I'll take a look
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
Chriss
RE: Anyone used VFP to read the windows event log?
have you even searched the forum?
in thread184-763970: How to copy the event log to a cursor Mike Gaganon is using WMI to read from the event log.
Chriss
RE: Anyone used VFP to read the windows event log?
to phrase the question!
Regards
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0
RE: Anyone used VFP to read the windows event log?
here's an adaption of the query, if you only want to read errors that were logged since November 2022, it's not standalone code, it's what you change in Mike Gagnons code:
CODE -->
Notice the terms for a Win32_NTLogEvent.Type are locale specific, for example 'Erreur' instead of 'Error' in French.
Chriss
RE: Anyone used VFP to read the windows event log?
Chriss
RE: Anyone used VFP to read the windows event log?
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0