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
- Int32CollectionConverter.cs
- FormViewInsertEventArgs.cs
- CodeDirectoryCompiler.cs
- KeyboardDevice.cs
- NativeMethods.cs
- PropertyGrid.cs
- FunctionQuery.cs
- SqlParameter.cs
- AuthenticatingEventArgs.cs
- SafeEventLogWriteHandle.cs
- PropertyCondition.cs
- OdbcTransaction.cs
- SolidBrush.cs
- ProjectionPathBuilder.cs
- xmlsaver.cs
- ModulesEntry.cs
- WebPartTracker.cs
- CanonicalizationDriver.cs
- Parser.cs
- MonthChangedEventArgs.cs
- ThousandthOfEmRealPoints.cs
- DataGridPagerStyle.cs
- SHA256Managed.cs
- AlternateView.cs
- EditCommandColumn.cs
- MemoryRecordBuffer.cs
- TextDecorationUnitValidation.cs
- CultureMapper.cs
- ZoneMembershipCondition.cs
- HttpWriter.cs
- ToolStripStatusLabel.cs
- _LocalDataStore.cs
- RectangleF.cs
- StringStorage.cs
- ToolStripHighContrastRenderer.cs
- AssemblyBuilderData.cs
- serverconfig.cs
- Membership.cs
- GroupBoxDesigner.cs
- DocumentPageView.cs
- DbgCompiler.cs
- RegexWorker.cs
- InvalidEnumArgumentException.cs
- DataGridColumnsPage.cs
- GridViewUpdatedEventArgs.cs
- FrameworkContentElement.cs
- RawStylusActions.cs
- MethodImplAttribute.cs
- WSTransactionSection.cs
- DiscardableAttribute.cs
- NavigationService.cs
- XmlSchemaGroupRef.cs
- HttpCachePolicyElement.cs
- KeyInstance.cs
- ConfigXmlComment.cs
- DeviceFiltersSection.cs
- GACMembershipCondition.cs
- IntSecurity.cs
- Block.cs
- IImplicitResourceProvider.cs
- BaseProcessor.cs
- OrderPreservingSpoolingTask.cs
- DuplexChannelFactory.cs
- HttpBrowserCapabilitiesWrapper.cs
- MetadataPropertyvalue.cs
- TrustSection.cs
- BindingRestrictions.cs
- ReverseInheritProperty.cs
- KernelTypeValidation.cs
- KnownBoxes.cs
- ToolStripContentPanelRenderEventArgs.cs
- DataMember.cs
- Size.cs
- File.cs
- OleDbCommand.cs
- ColumnBinding.cs
- BookmarkUndoUnit.cs
- XmlSchemaSimpleTypeUnion.cs
- TreeNodeStyle.cs
- ASCIIEncoding.cs
- TextSelectionProcessor.cs
- XmlSchemaAttributeGroupRef.cs
- HtmlTableCell.cs
- ListBox.cs
- Pair.cs
- StringUtil.cs
- LineServicesRun.cs
- HandlerFactoryCache.cs
- SqlDataSource.cs
- XmlSchemaAppInfo.cs
- CounterSample.cs
- DocumentPageTextView.cs
- EditableRegion.cs
- RestClientProxyHandler.cs
- NamespaceQuery.cs
- FocusManager.cs
- StyleCollectionEditor.cs
- LambdaCompiler.Expressions.cs
- DataBindingCollectionEditor.cs
- ConnectionInterfaceCollection.cs