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
- WindowsAltTab.cs
- TreeViewItemAutomationPeer.cs
- MasterPageParser.cs
- AsyncDataRequest.cs
- PerspectiveCamera.cs
- DataServiceConfiguration.cs
- SettingsBase.cs
- FlowDocumentScrollViewer.cs
- DataGridViewAccessibleObject.cs
- RtfToXamlReader.cs
- DropDownList.cs
- _CommandStream.cs
- PermissionSetEnumerator.cs
- LineUtil.cs
- _NegoState.cs
- MobileContainerDesigner.cs
- RTTypeWrapper.cs
- FormCollection.cs
- PropertyPanel.cs
- HTMLTagNameToTypeMapper.cs
- HeaderFilter.cs
- TransactionsSectionGroup.cs
- PropertyDescriptorComparer.cs
- RelationshipConverter.cs
- CapiSymmetricAlgorithm.cs
- XslException.cs
- SerTrace.cs
- MiniMapControl.xaml.cs
- BitmapCodecInfo.cs
- XPathDocumentIterator.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- QueryCacheKey.cs
- ObjectListCommandEventArgs.cs
- listitem.cs
- FunctionNode.cs
- AssertUtility.cs
- TextTreeTextBlock.cs
- FormsAuthenticationModule.cs
- PartialArray.cs
- WebPartPersonalization.cs
- ListView.cs
- BindingCollection.cs
- ToolTipAutomationPeer.cs
- GetWinFXPath.cs
- MetadataCollection.cs
- MetadataStore.cs
- ConnectionManagementSection.cs
- DbXmlEnabledProviderManifest.cs
- NullableFloatAverageAggregationOperator.cs
- GridLengthConverter.cs
- TouchFrameEventArgs.cs
- TextServicesProperty.cs
- Point3DCollection.cs
- ButtonFlatAdapter.cs
- EntityDataSourceColumn.cs
- CompiledQueryCacheEntry.cs
- TextDecoration.cs
- XD.cs
- BindingGraph.cs
- EventRouteFactory.cs
- X509ThumbprintKeyIdentifierClause.cs
- ClientSponsor.cs
- FontStyleConverter.cs
- XamlSerializerUtil.cs
- HtmlTitle.cs
- WindowsStatic.cs
- SimpleLine.cs
- XsltOutput.cs
- ManifestResourceInfo.cs
- Array.cs
- ClassicBorderDecorator.cs
- COMException.cs
- CellTreeNodeVisitors.cs
- ZipFileInfoCollection.cs
- ControllableStoryboardAction.cs
- WebPartManagerInternals.cs
- RegexNode.cs
- SoapServerMethod.cs
- InputProviderSite.cs
- RuleAction.cs
- BufferedReadStream.cs
- FormCollection.cs
- DBAsyncResult.cs
- XsltQilFactory.cs
- ComponentEditorPage.cs
- CommandSet.cs
- PolicyStatement.cs
- XmlAutoDetectWriter.cs
- ClientUrlResolverWrapper.cs
- FullTrustAssemblyCollection.cs
- XPathDocumentIterator.cs
- JoinElimination.cs
- ScriptingSectionGroup.cs
- WebPartConnection.cs
- SerializationHelper.cs
- Trace.cs
- ProcessInputEventArgs.cs
- DataBinder.cs
- DelegatingStream.cs
- IntegerCollectionEditor.cs