Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventLogInformation.cs / 1305376 / EventLogInformation.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLogInformation ** ** Purpose: ** The objects of this class allow access to the run-time ** properties of logs and external log files. An instance of this ** class is obtained from EventLogSession. ** ============================================================*/ using System; using System.Runtime.InteropServices; using Microsoft.Win32; namespace System.Diagnostics.Eventing.Reader { ////// Describes the run-time properties of logs and external log files. An instance /// of this class is obtained from EventLogSession. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventLogInformation { DateTime? creationTime; DateTime? lastAccessTime; DateTime? lastWriteTime; long? fileSize; int? fileAttributes; long? recordCount; long? oldestRecordNumber; bool? isLogFull; [System.Security.SecuritySafeCritical] internal EventLogInformation(EventLogSession session, string channelName, PathType pathType) { EventLogPermissionHolder.GetEventLogPermission().Demand(); EventLogHandle logHandle = NativeWrapper.EvtOpenLog(session.Handle, channelName, pathType); using (logHandle) { creationTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogCreationTime); lastAccessTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastAccessTime); lastWriteTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastWriteTime); fileSize = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFileSize)); fileAttributes = (int?)((uint?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogAttributes)); recordCount = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogNumberOfLogRecords)); oldestRecordNumber = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogOldestRecordNumber)); isLogFull = (bool?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFull); } } public DateTime? CreationTime { get { return creationTime; } } public DateTime? LastAccessTime { get { return lastAccessTime; } } public DateTime? LastWriteTime { get { return lastWriteTime; } } public long? FileSize { get { return fileSize; } } public int? Attributes { get { return fileAttributes; } } public long? RecordCount { get { return recordCount; } } public long? OldestRecordNumber { get { return oldestRecordNumber; } } public bool? IsLogFull { get { return isLogFull; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlText.cs
- Thread.cs
- Pair.cs
- ResourcesBuildProvider.cs
- dataprotectionpermission.cs
- AutoResetEvent.cs
- AlphaSortedEnumConverter.cs
- InternalBase.cs
- NumberEdit.cs
- UriTemplateHelpers.cs
- FactoryGenerator.cs
- EndEvent.cs
- OperandQuery.cs
- FixedTextBuilder.cs
- ToolStripSeparatorRenderEventArgs.cs
- SerializationException.cs
- ExponentialEase.cs
- TimeoutHelper.cs
- Utils.cs
- RelationshipManager.cs
- M3DUtil.cs
- BufferedGraphicsManager.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- IUnknownConstantAttribute.cs
- SizeAnimationUsingKeyFrames.cs
- WebPartVerb.cs
- RegexMatchCollection.cs
- ErrorFormatter.cs
- Span.cs
- WebPartDeleteVerb.cs
- translator.cs
- Int32KeyFrameCollection.cs
- SymbolUsageManager.cs
- LinkClickEvent.cs
- ThreadAbortException.cs
- Variable.cs
- ExpandCollapseProviderWrapper.cs
- IOException.cs
- SkewTransform.cs
- LinqDataSourceContextEventArgs.cs
- RowVisual.cs
- RulePatternOps.cs
- SchemaName.cs
- DrawingGroup.cs
- IOException.cs
- XMLDiffLoader.cs
- TranslateTransform3D.cs
- ADMembershipProvider.cs
- InputBinding.cs
- DbDataRecord.cs
- ApplicationContext.cs
- Utils.cs
- MatrixStack.cs
- Int16Storage.cs
- ChineseLunisolarCalendar.cs
- ZoneIdentityPermission.cs
- FrameworkObject.cs
- ACL.cs
- WebBodyFormatMessageProperty.cs
- XmlSchemaComplexContentRestriction.cs
- InputManager.cs
- PropertyGeneratedEventArgs.cs
- ExpressionNode.cs
- CodeSnippetStatement.cs
- XmlSchemaAttributeGroup.cs
- Journal.cs
- PropertyGeneratedEventArgs.cs
- ServiceNameCollection.cs
- StringDictionaryCodeDomSerializer.cs
- EntityDataSourceMemberPath.cs
- RoleExceptions.cs
- Point3DCollection.cs
- ExceptionUtility.cs
- RootProfilePropertySettingsCollection.cs
- RegexRunner.cs
- PlainXmlSerializer.cs
- StrokeCollection.cs
- DataControlButton.cs
- TabPage.cs
- GPStream.cs
- PathSegment.cs
- Point3D.cs
- DataGridColumn.cs
- DictionaryContent.cs
- SerialErrors.cs
- httpstaticobjectscollection.cs
- CheckBoxAutomationPeer.cs
- HttpContextBase.cs
- GeneralTransform3DGroup.cs
- EventDescriptorCollection.cs
- HtmlTableRowCollection.cs
- UnsafeNativeMethods.cs
- GridViewCellAutomationPeer.cs
- RuleSettingsCollection.cs
- IERequestCache.cs
- IndexOutOfRangeException.cs
- PathFigure.cs
- New.cs
- Timer.cs
- OverlappedAsyncResult.cs