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
- PageAdapter.cs
- SystemException.cs
- ComboBox.cs
- DataRowComparer.cs
- ServiceProviders.cs
- XmlTextReaderImpl.cs
- NameScope.cs
- CompositeKey.cs
- TemplatedWizardStep.cs
- PreviewKeyDownEventArgs.cs
- ISO2022Encoding.cs
- QilVisitor.cs
- DesigntimeLicenseContext.cs
- DataGridViewDataErrorEventArgs.cs
- XamlPathDataSerializer.cs
- EtwTrace.cs
- FixedSOMPage.cs
- WorkflowDurableInstance.cs
- OleDbReferenceCollection.cs
- ProcessModule.cs
- DbProviderFactories.cs
- Endpoint.cs
- EntityClassGenerator.cs
- CardSpaceException.cs
- TabItemAutomationPeer.cs
- IisTraceListener.cs
- EntityDataSourceMemberPath.cs
- TypeListConverter.cs
- DataGridViewComboBoxColumn.cs
- BitmapEffectInputConnector.cs
- ScrollViewer.cs
- RequestQueryParser.cs
- AccessedThroughPropertyAttribute.cs
- DeflateStream.cs
- TableLayoutStyle.cs
- ToolBarPanel.cs
- WindowsRichEdit.cs
- RecognizerStateChangedEventArgs.cs
- EndpointBehaviorElement.cs
- DocumentViewerAutomationPeer.cs
- ObjectListCommandsPage.cs
- EditingScopeUndoUnit.cs
- DragEvent.cs
- DecimalAnimationBase.cs
- ChtmlFormAdapter.cs
- IntranetCredentialPolicy.cs
- AssemblyUtil.cs
- ManifestResourceInfo.cs
- RSAPKCS1SignatureFormatter.cs
- XamlToRtfWriter.cs
- OlePropertyStructs.cs
- TextServicesPropertyRanges.cs
- TileBrush.cs
- HttpWriter.cs
- AssemblyContextControlItem.cs
- BindingsCollection.cs
- AssemblyName.cs
- CompositeDataBoundControl.cs
- SetStoryboardSpeedRatio.cs
- PageContentCollection.cs
- HttpModuleAction.cs
- Vertex.cs
- TypeSystem.cs
- CodeArrayIndexerExpression.cs
- MethodRental.cs
- _Connection.cs
- StylusDownEventArgs.cs
- StorageEntitySetMapping.cs
- VectorCollection.cs
- XmlNodeChangedEventArgs.cs
- XmlIncludeAttribute.cs
- ExceptionHandler.cs
- CheckBoxAutomationPeer.cs
- DefaultEvaluationContext.cs
- TextPointerBase.cs
- panel.cs
- CodeDomLocalizationProvider.cs
- ControlLocalizer.cs
- ProcessStartInfo.cs
- ScrollBar.cs
- QueryExpr.cs
- AxHost.cs
- ContentType.cs
- NameObjectCollectionBase.cs
- MessageEncodingBindingElement.cs
- ApplicationSecurityInfo.cs
- XmlMapping.cs
- TreeNode.cs
- datacache.cs
- CleanUpVirtualizedItemEventArgs.cs
- FixedElement.cs
- LocatorGroup.cs
- CodeIterationStatement.cs
- AsyncPostBackErrorEventArgs.cs
- HttpHostedTransportConfiguration.cs
- TextHintingModeValidation.cs
- SpeechUI.cs
- BindingExpression.cs
- VectorCollection.cs
- Thickness.cs