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
- ObjectDataSourceChooseTypePanel.cs
- AutomationTextAttribute.cs
- RelationshipDetailsRow.cs
- NotImplementedException.cs
- StyleXamlTreeBuilder.cs
- ProcessHostMapPath.cs
- WebDescriptionAttribute.cs
- CopyAction.cs
- HashCodeCombiner.cs
- BrushMappingModeValidation.cs
- BrushValueSerializer.cs
- TransformerInfo.cs
- dbenumerator.cs
- Int16Converter.cs
- TransformCryptoHandle.cs
- OleDbSchemaGuid.cs
- DockPattern.cs
- translator.cs
- ProfileEventArgs.cs
- DataFormats.cs
- TextComposition.cs
- CollectionChangeEventArgs.cs
- FileController.cs
- InternalConfigEventArgs.cs
- AutomationPropertyInfo.cs
- SiteMapHierarchicalDataSourceView.cs
- XPathNodeInfoAtom.cs
- ZipIOExtraFieldPaddingElement.cs
- StreamInfo.cs
- Trace.cs
- TailCallAnalyzer.cs
- EventSource.cs
- ReturnValue.cs
- SpeechEvent.cs
- ReachBasicContext.cs
- MenuCommands.cs
- MediaElementAutomationPeer.cs
- SynchronizationScope.cs
- NetworkInformationException.cs
- newinstructionaction.cs
- AddInServer.cs
- ObjectSecurity.cs
- DesignOnlyAttribute.cs
- IconConverter.cs
- XmlSchemaIdentityConstraint.cs
- CollectionsUtil.cs
- Itemizer.cs
- SchemaNames.cs
- CopyOnWriteList.cs
- TraceContext.cs
- Setter.cs
- Mutex.cs
- ExecutionEngineException.cs
- RectAnimationClockResource.cs
- HandlerMappingMemo.cs
- PieceNameHelper.cs
- OleDbEnumerator.cs
- HandlerMappingMemo.cs
- ActiveXHost.cs
- filewebresponse.cs
- XmlSchemaSimpleTypeList.cs
- DbConvert.cs
- AlternationConverter.cs
- LogicalTreeHelper.cs
- ImageFormat.cs
- TraceHandlerErrorFormatter.cs
- SortFieldComparer.cs
- TrustLevel.cs
- FormViewUpdatedEventArgs.cs
- IndependentAnimationStorage.cs
- FixedLineResult.cs
- LayoutTableCell.cs
- Pair.cs
- EventLogPropertySelector.cs
- Subtree.cs
- ProviderCollection.cs
- MiniAssembly.cs
- SafeNativeMethodsOther.cs
- ObjectStateManagerMetadata.cs
- BinaryCommonClasses.cs
- FixedPageAutomationPeer.cs
- TextEditorLists.cs
- OdbcErrorCollection.cs
- BeginStoryboard.cs
- UriTemplateTableMatchCandidate.cs
- ToolStripScrollButton.cs
- LineServicesRun.cs
- HtmlControl.cs
- Transform3DGroup.cs
- PolicyManager.cs
- RewritingValidator.cs
- WebPartConnectionsCloseVerb.cs
- DataGridViewDataConnection.cs
- UriTemplateDispatchFormatter.cs
- MimeTypeMapper.cs
- PageThemeCodeDomTreeGenerator.cs
- DataGridViewAutoSizeModeEventArgs.cs
- WorkflowInstanceSuspendedRecord.cs
- StatusBar.cs
- AdCreatedEventArgs.cs