Export (0) Print
Expand All

LogRecordSequence Constructor (String, FileMode, FileAccess, FileShare, Int32, Int32, FileSecurity)

Initializes a new instance of the LogRecordSequence class.

Namespace:  System.IO.Log
Assembly:  System.IO.Log (in System.IO.Log.dll)

public LogRecordSequence(
	string path,
	FileMode mode,
	FileAccess access,
	FileShare share,
	int bufferSize,
	int bufferCount,
	FileSecurity fileSecurity
)

Parameters

path
Type: System.String

A relative or absolute path for the base file of the log store to open.

mode
Type: System.IO.FileMode

A valid FileMode value that determines how to open or create the store.

access
Type: System.IO.FileAccess

A valid FileAccess value that determines how the log store can be accessed.

share
Type: System.IO.FileShare

A valid FileShare value that determines how the log store will be shared among processes.

bufferSize
Type: System.Int32

The desired buffer size in bytes. The buffer size determines the maximum size of the record that can be appended or read.

bufferCount
Type: System.Int32

The desired number of buffers.

fileSecurity
Type: System.Security.AccessControl.FileSecurity

A valid FileSecurity value that specifies the security to set on the newly created store if the store must be created.

ExceptionCondition
ArgumentException

The file specified by path is not valid.

-or-

The specified log store file name is not valid.

-or-

mode has a value of CreateNew, and cannot be used without write access.

-or-

mode has a value of OpenOrCreate, and cannot be used without write access.

ArgumentNullException

One or more of the arguments are null.

ArgumentOutOfRangeException

One or more of the arguments are out of range.

FileNotFoundException

The file specified by path cannot be found.

IOException

The request could not be performed because of an unexpected I/O exception.

-or-

The file specified by path cannot be accessed because it is in use by another process.

-or-

The file specified by path cannot be created because the file or directory already exists.

-or-

The log handle could not be bound to the thread pool.

-or-

The specified log file format or version is invalid.

NotSupportedException

This operation is not supported.

ObjectDisposedException

The method was called after the sequence has been disposed of.

OutOfMemoryException

There is not enough memory to continue the execution of the program.

PlatformNotSupportedException

LogRecordSequence cannot be used because the required Common Log File System (CLFS) component is not installed. Install the CLFS component if it is available for your platform, or use the FileRecordSequence class.

SequenceFullException

The record sequence is full.

UnauthorizedAccessException

Access for the specified log sequence is denied by the operating system.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft