Search:
Namespaces
Discussions
.NET v1.1
Feedback
UNANSWERED : Writing an event log : User N/A ! ( (first posted on Jan 16)
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngdebug' list
.
RRamirez@belcorporation.com
-- Copied from [aspngfreeforall] to [aspngdebug] by Charles M. Carroll <
Click here to reveal e-mail address
> --
writing *useful/professional* event logs with VB6 was a real PIA, I've lost
the count of how many times I've read LJ Jhonson article on the subject (on
VBPJ,
http://www.devx.com/premier/mgznarch/vbpj/2001/09sep01/lj0109/lj0109-1.asp
)
and I still think it's a real nightmare.... VB6 App.LogEvent sucks... you
can't change the source fields (it's always VBRuntime) .... it doesn't work
while in the IDE.... and so on....
but .NET changes this... write event logs is real easy... so I was waiting
for the final release to install the framework on one of our Windows2000
servers to test this feature.....
I was able to comunicate VB6 Apps with a NET DLL (thanks to a Bipin Joshi
article,
http://www.bipinjoshi.com/com/com
_iop.asp?language=com&page=1),
this net dll has a class wich has method that writes events.... but what
I've not been able to find a method o property that let me set the User
field, the WriteEntry method of the
EventLog
class doesn't seem to use this
field... any ideas ?
thanks,
Rolando
Reply to this message...
Rob Caron
Are you referring to the UserName property of the
EventLogEntry
class?
If so, this property is read-only and usually only appears in the
Security log.
When used, it's the SID of the user or group.
- Rob Caron (
Click here to reveal e-mail address
)
-----Original Message-----
From:
Click here to reveal e-mail address
[mailto:
Click here to reveal e-mail address
]=20
Sent: Wednesday, January 30, 2002 11:23 AM
To: aspngdebug
Subject: [aspngdebug] UNANSWERED : Writing an event log : User N/A !! (
(first posted on Jan 16)
-- Copied from [aspngfreeforall] to [aspngdebug] by Charles M. Carroll
<
Click here to reveal e-mail address
> --
writing *useful/professional* event logs with VB6 was a real PIA, I've
lost the count of how many times I've read LJ Jhonson article on the
subject (on VBPJ,
http://www.devx.com/premier/mgznarch/vbpj/2001/09sep01/lj0109/lj0109-1.a
sp)
and I still think it's a real nightmare.... VB6 App.LogEvent sucks...
you can't change the source fields (it's always VBRuntime) .... it
doesn't work while in the IDE.... and so on....
but .NET changes this... write event logs is real easy... so I was
waiting for the final release to install the framework on one of our
Windows2000 servers to test this feature.....
I was able to comunicate VB6 Apps with a NET DLL (thanks to a Bipin
Joshi article,
http://www.bipinjoshi.com/com/com
_iop.asp?language=3Dcom&page=3D1),
this net dll has a class wich has method that writes events.... but what
I've not been able to find a method o property that let me set the User
field, the WriteEntry method of the
EventLog
class doesn't seem to use
this field... any ideas ?
thanks,
Rolando
| [aspngdebug] member
Click here to reveal e-mail address
=3D YOUR ID=20
|
http://www.asplists.com/asplists/aspngdebug.asp
=3D JOIN/QUIT=20
|
http://www.asplists.com/search
=3D SEARCH Archives
Reply to this message...
Rob Caron
Unfortunately, in the .NET Framework the UserName property of the =
EventLogEntry
class is Read-Only. I haven't confirmed this, but it looks =
like this property is only populated with the SID by the .NET Framework =
when writing to the Security log.
----- Original Message -----
From:
Click here to reveal e-mail address
To:
Click here to reveal e-mail address
Sent: Wed, 30 Jan 2002 19:57:19 -0500
Subject: RE: UNANSWERED : Writing an event log : User N/A !! ( (first =
posted on Jan
16)
Hi Rob,thanks for taking the time to help me with my problem...
I'm talking about the User field/column of a logged event....
after logging an event using the
EventLog
.WriteEntry method, when I go =
to
the event viewer and see the event the "User" column.... it has this =
value
: "N/A"
but using the technique described by LJ Jhonson using the ReportEvent() =
API
it seems it's posible to set this field with a real username
"When you pass the SID to the ReportEvent() API, the user's name appears =
in
the event log record. All you need to do is open a process token for the
current process, then get the token information for the user running =
that
process. Normally, this is the user who last logged onto the machine.
However, you can run processes as, for example, LocalSystem (as in an NT
service), or the application's author can impersonate other users so =
that
process could return users besides the currently logged-on user."
Rolando
=
=20
=
=20
=
=20
=
=20
=
=20
"Rob Caron" =
=20
<robcaron@micr Para: "aspngdebug" =
<
Click here to reveal e-mail address
> =20
osoft.com> cc: =
=20
Asunto: [aspngdebug] RE: =
UNANSWERED : Writing an event log : User =20
30/01/2002 N/A !! ( (first posted on Jan =
16) =20
19:00 =
=20
Por favor, =
=20
responda a =
=20
"aspngdebug" =
=20
=
=20
=
=20
Are you referring to the UserName property of the
EventLogEntry
class?
If so, this property is read-only and usually only appears in the
Security log.
When used, it's the SID of the user or group.
- Rob Caron (
Click here to reveal e-mail address
)
-----Original Message-----
From:
Click here to reveal e-mail address
[mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, January 30, 2002 11:23 AM
To: aspngdebug
Subject: [aspngdebug] UNANSWERED : Writing an event log : User N/A !! (
(first posted on Jan 16)
-- Copied from [aspngfreeforall] to [aspngdebug] by Charles M. Carroll
<
Click here to reveal e-mail address
> --
writing *useful/professional* event logs with VB6 was a real PIA, I've
lost the count of how many times I've read LJ Jhonson article on the
subject (on VBPJ,
http://www.devx.com/premier/mgznarch/vbpj/2001/09sep01/lj0109/lj0109-1.a
sp)
and I still think it's a real nightmare.... VB6 App.LogEvent sucks...
you can't change the source fields (it's always VBRuntime) .... it
doesn't work while in the IDE.... and so on....
but .NET changes this... write event logs is real easy... so I was
waiting for the final release to install the framework on one of our
Windows2000 servers to test this feature.....
I was able to comunicate VB6 Apps with a NET DLL (thanks to a Bipin
Joshi article,
http://www.bipinjoshi.com/com/com
_iop.asp?language=3Dcom&page=3D1),
this net dll has a class wich has method that writes events.... but what
I've not been able to find a method o property that let me set the User
field, the WriteEntry method of the
EventLog
class doesn't seem to use
this field... any ideas ?
thanks,
Rolando
| [aspngdebug] member
Click here to reveal e-mail address
=3D YOUR ID
|
http://www.asplists.com/asplists/aspngdebug.asp
=3D JOIN/QUIT
|
http://www.asplists.com/search
=3D SEARCH Archives
| [aspngdebug] member
Click here to reveal e-mail address
=3D YOUR ID
|
http://www.asplists.com/asplists/aspngdebug.asp
=3D JOIN/QUIT
|
http://www.asplists.com/search
=3D SEARCH Archives
Reply to this message...
System.Diagnostics.EventLog
System.Diagnostics.EventLogEntry
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com