Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일

VS.NET 도움말에서 "Win32_NTLogEvent" 항목을 찾아보면 다음과 같은 설명이 나옵니다.

The Win32_NTLogEvent WMI class is used to translate instances from the Windows NT event log. An application must have SeSecurityPrivilege in order to receive events from the security event log, otherwise "Access Denied" is returned to the application.

즉, "SeSecurityPrivilege" 가 있어야 한다는 거죠.
확실히 장담할 수는 없지만, Windows 2003 의 경우에는 .NET WMI 클래스가 정상적으로 특권설정을 하는 것 같은 데, Windows 2000 의 경우에는 그렇지 못해서 결국 "Access Denied" 예외가 발생하게 됩니다.

따라서, 첨부된 COM 개체를 .NET 프로젝트에서 참조한 후 다음과 같이 코드를 작성하면 됩니다.

Win32LegacyLib.SecuritiesClass priv = new Win32LegacyLib.SecuritiesClass();
priv.EnablePrivilege( "SeSecurityPrivilege" );

_watcher = new ManagementEventWatcher( new EventQuery("SELECT * FROM __InstanceCreationEvent WHERE TargetInstance ISA 'Win32_NTLogEvent'"));

_watcher.EventArrived += new EventArrivedEventHandler(Arrived);
_watcher.Start();









[최초 등록일: ]
[최종 수정일: 2/16/2005]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 166  167  168  169  [170]  171  172  173  174  175  176  177  178  179  180  ...
NoWriterDateCnt.TitleFile(s)
842정성태3/17/201029239Windows: 49. VHD 파일 지원
841정성태3/16/201029927.NET Framework: 174. 작업자 프로세스(w3wp.exe)가 재시작되는 시점을 알 수 있는 방법 [1]
840정성태3/4/201023221개발 환경 구성: 71. w3wp.exe에 환경 변수 전달하는 방법 [1]
836정성태2/13/201026524VS.NET IDE: 67. Visual Studio 2010: 베타 2에서 RC 마이그레이션
835정성태1/26/201028025.NET Framework: 173. WCF - webHttpBinding + IIS 6.0 윈도우 인증 구현 예제 [3]파일 다운로드1
834정성태1/25/201028437.NET Framework: 172. WCF - webHttpBinding 윈도우 인증 구현 예제 [3]파일 다운로드1
833정성태1/25/201028021.NET Framework: 171. WCF - webHttpBinding 구현 예제 [1]파일 다운로드1
832정성태1/25/201031558.NET Framework: 170. PerformanceCounter의 RawValue/NextValue()에서 멈춤 현상
831정성태1/14/201021100개발 환경 구성: 70. WSS - check out 메뉴에서 오류나는 문제
830정성태1/10/201025991개발 환경 구성: 69. Windows Internal Database
829정성태1/7/201025127개발 환경 구성: 68. ODP.NET + OraMTS 사용
828정성태1/7/201032842개발 환경 구성: 67. 환경 변수를 이용한 다중 ODAC 버전 테스트
827정성태1/4/201025133개발 환경 구성: 66. .NET 응용 프로그램에서 64비트 Oracle Data Access Components 사용 (2)
826정성태1/3/201032858기타: 28. 2009년 인기 순위 정리
825정성태1/3/201049695개발 환경 구성: 65. .NET 응용 프로그램에서 64비트 Oracle Data Access Components 사용 [5]
823정성태1/1/201026662개발 환경 구성: 64. ODP.NET 설치 작업 없이 ASP.NET 응용 프로그램 배포파일 다운로드1
822정성태1/1/201089542개발 환경 구성: 63. ODP.NET 설치 없이 .NET 클라이언트 프로그램 배포하는 방법 [6]파일 다운로드2
821정성태1/1/201051888개발 환경 구성: 62. .NET 응용 프로그램에서 Oracle XE 사용 [1]
820정성태12/29/200923407개발 환경 구성: 61. Oxite 소스 코드를 Visual Studio 2010으로 마이그레이션파일 다운로드1
818정성태12/27/200921922개발 환경 구성: 60. Cassini 서버를 localhost 이외의 주소에서 접근하도록 변경
817정성태12/21/200923482개발 환경 구성: 59. WebDev 2.0에서 실행하는 Pet Shop 4.0
816정성태12/19/200925278개발 환경 구성: 58. Pet Shop 4.0을 IIS 없이 실행하는 방법 [1]파일 다운로드1
815정성태12/18/200928237개발 환경 구성: 57. Pet Shop 4.0 - SQL Server Compact Edition Version - 두 번째 이야기파일 다운로드1
814정성태12/16/200923194오류 유형: 91. VS2010 beta2 - The application cannot start
812정성태12/11/200927352개발 환경 구성: 56. Pet Shop 4.0 - SQL Server Compact Edition Version파일 다운로드2
811정성태12/2/200941708.NET Framework: 169. [in, out] 배열을 C#에서 C/C++로 넘기는 방법 - 두 번째 이야기 [8]파일 다운로드2
... 166  167  168  169  [170]  171  172  173  174  175  176  177  178  179  180  ...