LogStore 构造函数

定义

初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class.

重载

LogStore(SafeFileHandle)

为指定的句柄初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class for the specified handle.

LogStore(String, FileMode)

使用指定的路径和模式初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class with the specified path and mode.

LogStore(String, FileMode, FileAccess)

使用指定的路径、模式和访问权限初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class with the specified path, mode, and access.

LogStore(String, FileMode, FileAccess, FileShare)

初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class.

LogStore(String, FileMode, FileAccess, FileShare, FileSecurity)

初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class.

LogStore(SafeFileHandle)

为指定的句柄初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class for the specified handle.

public:
 LogStore(Microsoft::Win32::SafeHandles::SafeFileHandle ^ handle);
public LogStore (Microsoft.Win32.SafeHandles.SafeFileHandle handle);
new System.IO.Log.LogStore : Microsoft.Win32.SafeHandles.SafeFileHandle -> System.IO.Log.LogStore
Public Sub New (handle As SafeFileHandle)

参数

handle
SafeFileHandle

当前 LogStore 对象包装的日志文件的文件句柄。A file handle for the log file that the current LogStore object encapsulates.

异常

handlenullhandle is null.

日志句柄无法绑定到线程池。The log handle could not be bound to the thread pool.

操作系统拒绝了对指定的日志存储区的访问。Access for the specified log store is denied by the operating system.

该方法是在序列已释放之后调用的。The method was called after the sequence has been disposed of.

没有足够的内存来继续执行程序。There is not enough memory to continue the execution of a program.

LogStore(String, FileMode)

使用指定的路径和模式初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class with the specified path and mode.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode);
public LogStore (string path, System.IO.FileMode mode);
new System.IO.Log.LogStore : string * System.IO.FileMode -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode)

参数

path
String

要打开的日志存储区的基文件的相对或绝对路径。A relative or absolute path for the base file of the log store to open.

mode
FileMode

用于确定如何打开或创建存储区的 FileMode 值之一。One of the FileMode values that determines how to open or create the store.

异常

pathnullpath is null.

path 为空字符串 ("")。path is an empty string ("").

-or- path 仅包含空白。path contains only white space.

-or- path 包含一个或多个无效字符。path contains one or more invalid characters.

mode 包含无效值。mode contains an invalid value.

无法找到该文件。The file cannot be found.

打开日志存储区时发生了 I/O 错误。An I/O error occurs when opening the log store.

操作系统拒绝了对指定的日志存储区的访问。Access for the specified log store is denied by the operating system.

无法使用 LogStore,因为没有安装所需的公用日志文件系统 (CLFS) 组件。LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. 如果可行,请为您的平台安装 CLFS 组件,或者改用 FileRecordSequence 类。Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

没有足够的内存来继续执行程序。There is not enough memory to continue the execution of a program.

注解

使用此构造函数打开具有指定路径和模式的日志存储区。Use this constructor to open a log store with the specified path and mode. 存储区以读/写访问权限打开,并共享读访问权限。The store is opened with read/write access, and shares read access.

path 参数应使用以下语法:The path parameter should use the following syntax:

log:<physical log name>[::<log client name>]

其中 <physical log name> 是日志文件的有效路径,<log client name> 是唯一客户端标识符。where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. 日志存储区应是物理日志存储区或虚拟日志存储区,但不能同时为两者。A log store should be either a physical log store or a virtual log store, but not both. 以物理或虚拟方式创建日志存储区后,它在整个生命周期中都将保持该形态。Once a log store has been created physically or virtually, it remains so for its lifetime. 物理日志存储区是通过仅指定物理日志名称来创建的。A physical log store is created by specifying only the physical log name. 虚拟日志存储区是通过指定物理日志名称和日志客户端名称来创建的。A virtual log store is created by specifying both the physical log name and the log client name.

共享同一个物理日志名称的客户端将共享相同的范围集合与策略。Clients that share the same physical log name share the same extents collection and policy.

LogStore(String, FileMode, FileAccess)

使用指定的路径、模式和访问权限初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class with the specified path, mode, and access.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access);
public LogStore (string path, System.IO.FileMode mode, System.IO.FileAccess access);
new System.IO.Log.LogStore : string * System.IO.FileMode * System.IO.FileAccess -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode, access As FileAccess)

参数

path
String

要打开的日志存储区的基文件的相对或绝对路径。A relative or absolute path for the base file of the log store to open.

mode
FileMode

用于确定如何打开或创建存储区的 FileMode 值之一。One of the FileMode values that determines how to open or create the store.

access
FileAccess

用于确定 FileAccess 可以如何访问文件的 LogStore 值之一。One of the FileAccess values that determines how the file can be accessed by the LogStore.

异常

pathnullpath is null.

path 为空字符串 ("")。path is an empty string ("").

- 或 --or- path 仅包含空白。path contains only white space.

-or- path 包含一个或多个无效字符。path contains one or more invalid characters.

mode 包含无效值。mode contains an invalid value.

- 或 --or access 包含无效值。access contains an invalid value.

无法找到该文件。The file cannot be found.

打开日志存储区时发生了 I/O 错误。An I/O error occurs when opening the log store.

操作系统拒绝了对指定的日志存储区的访问。Access for the specified log store is denied by the operating system.

无法使用 LogStore,因为没有安装所需的公用日志文件系统 (CLFS) 组件。LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. 如果可行,请为您的平台安装 CLFS 组件,或者改用 FileRecordSequence 类。Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

没有足够的内存来继续执行程序。There is not enough memory to continue the execution of a program.

注解

使用此构造函数打开具有指定的路径、模式和访问权限的新日志存储区。Use this constructor to open a new log store with the specified path, mode, and access. 并打开了存储区以共享读访问权限。The store is opened sharing read access.

path 参数应使用以下语法:The path parameter should use the following syntax:

log:<physical log name>[::<log client name>]

其中 <physical log name> 是日志文件的有效路径,<log client name> 是唯一客户端标识符。where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. 日志存储区应是物理日志存储区或虚拟日志存储区,但不能同时为两者。A log store should be either a physical log store or a virtual log store, but not both. 以物理或虚拟方式创建日志存储区后,它在整个生命周期中都将保持该形态。Once a log store has been created physically or virtually, it remains so for its lifetime. 物理日志存储区是通过仅指定物理日志名称来创建的。A physical log store is created by specifying only the physical log name. 虚拟日志存储区是通过指定物理日志名称和日志客户端名称来创建的。A virtual log store is created by specifying both the physical log name and the log client name.

共享同一个物理日志名称的客户端将共享相同的范围集合与策略。Clients that share the same physical log name share the same extents collection and policy.

LogStore(String, FileMode, FileAccess, FileShare)

初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share);
public LogStore (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share);
new System.IO.Log.LogStore : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare)

参数

path
String

要打开的日志存储区的基文件的相对或绝对路径。A relative or absolute path for the base file of the log store to open.

mode
FileMode

用于确定如何打开或创建存储区的 FileMode 值之一。One of the FileMode values that determines how to open or create the store.

access
FileAccess

用于确定 FileAccess 可以如何访问文件的 LogStore 值之一。One of the FileAccess values that determines how the file can be accessed by the LogStore.

share
FileShare

用于确定日志存储区将如何在进程之间共享的 FileShare 值之一。One of the FileShare values that determines how the log store will be shared among processes.

异常

pathnullpath is null.

path 为空字符串 ("")。path is an empty string ("").

- 或 --or- path 仅包含空白。path contains only white space.

-or- path 包含一个或多个无效字符。path contains one or more invalid characters.

mode 包含无效值。mode contains an invalid value.

- 或 --or access 包含无效值。access contains an invalid value.

- 或 --or- share 包含无效值。share contains an invalid value.

无法找到该文件。The file cannot be found.

打开日志存储区时发生了 I/O 错误。An I/O error occurs when opening the log store.

操作系统拒绝了对指定的日志存储区的访问。Access for the specified log store is denied by the operating system.

无法使用 LogStore,因为没有安装所需的公用日志文件系统 (CLFS) 组件。LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. 如果可行,请为您的平台安装 CLFS 组件,或者改用 FileRecordSequence 类。Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

没有足够的内存来继续执行程序。There is not enough memory to continue the execution of a program.

注解

此构造函数初始化它以指定的路径、模式和访问权限打开的新 LogStore 对象。This constructor initializes a new LogStore object that it opens with the specified path, mode, and access. 并打开了存储区以共享指定的访问权限。The store is opened sharing the specified access.

path 参数应使用以下语法:The path parameter should use the following syntax:

log:<physical log name>[::<log client name>]

其中 <physical log name> 是日志文件的有效路径,<log client name> 是唯一客户端标识符。where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. 日志存储区应是物理日志存储区或虚拟日志存储区,但不能同时为两者。A log store should be either a physical log store or a virtual log store, but not both. 以物理或虚拟方式创建日志存储区后,它在整个生命周期中都将保持该形态。Once a log store has been created physically or virtually, it remains so for its lifetime. 物理日志存储区是通过仅指定物理日志名称来创建的。A physical log store is created by specifying only the physical log name. 虚拟日志存储区是通过指定物理日志名称和日志客户端名称来创建的。A virtual log store is created by specifying both the physical log name and the log client name.

共享同一个物理日志名称的客户端将共享相同的范围集合与策略。Clients that share the same physical log name share the same extents collection and policy.

LogStore(String, FileMode, FileAccess, FileShare, FileSecurity)

初始化 LogStore 类的新实例。Initializes a new instance of the LogStore class.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share, System::Security::AccessControl::FileSecurity ^ fileSecurity);
public LogStore (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Security.AccessControl.FileSecurity fileSecurity);
new System.IO.Log.LogStore : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare * System.Security.AccessControl.FileSecurity -> System.IO.Log.LogStore

参数

path
String

要打开的日志存储区的基文件的相对或绝对路径。A relative or absolute path for the base file of the log store to open.

mode
FileMode

用于确定如何打开或创建存储区的 FileMode 值之一。One of the FileMode values that determines how to open or create the store.

access
FileAccess

用于确定 FileAccess 可以如何访问文件的 LogStore 值之一。One of the FileAccess values that determines how the file can be accessed by the LogStore.

share
FileShare

用于确定日志存储区将如何在进程之间共享的 FileShare 值之一。One of the FileShare values that determines how the log store will be shared among processes.

fileSecurity
FileSecurity

FileSecurity 值之一,指定在必须创建存储区的情况下,要为新创建的存储区设置的安全性。One of the FileSecurity value that specifies the security to set on the newly created store if the store must be created.

异常

pathnullpath is null.

path 指定的日志存储区文件名无效。The log store file name specified by path is not valid.

- 或 --or- ModeCreateNew,在没有写访问权限的情况下无法使用它。Mode is CreateNew, which cannot be used without write access.

-or- ModeOpenOrCreate,在没有写访问权限的情况下无法使用它。Mode is OpenOrCreate, which cannot be used without write access.

mode 包含无效值。mode contains an invalid value.

- 或 --or access 包含无效值。access contains an invalid value.

- 或 --or- share 包含无效值。share contains an invalid value.

无法找到该文件。The file cannot be found.

打开日志存储区时发生了 I/O 错误。An I/O error occurs when opening the log store.

无法访问 path 指定的文件,因为另一个进程正在使用该文件。The file specified by path cannot be accessed because it is in use by another process.

-or- 无法创建 path 指定的文件,因为该文件或目录已存在。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.

无法使用 LogStore,因为没有安装所需的公用日志文件系统 (CLFS) 组件。LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. 如果可行,请为您的平台安装 CLFS 组件,或者改用 FileRecordSequence 类。Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

该方法是在序列已释放之后调用的。The method was called after the sequence has been disposed of.

没有足够的内存来继续执行程序。There is not enough memory to continue the execution of a program.

记录序列已满。The record sequence is full.

操作系统拒绝了对指定的日志存储区的访问。Access for the specified log store is denied by the operating system.

注解

此构造函数初始化它以指定的路径、模式和访问权限打开的新 LogStore 对象。This constructor initializes a new LogStore object that it opens with the specified path, mode, and access. 并打开了存储区以共享指定的访问权限。The store is opened sharing the specified access. path 参数应遵循以下语法:The path parameter should follow the following syntax:

log:<physical log name>[::<log client name>]

其中 <physical log name> 是日志文件的有效路径,<log client name> 是唯一客户端标识符。where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. 日志存储区应是物理日志存储区或虚拟日志存储区,但不能同时为两者。A log store should be either a physical log store or a virtual log store, but not both. 以物理或虚拟方式创建日志存储区后,它在整个生命周期中都将保持该形态。Once a log store has been created physically or virtually, it remains so for its lifetime. 物理日志存储区是通过仅指定物理日志名称来创建的。A physical log store is created by specifying only the physical log name. 虚拟日志存储区是通过指定物理日志名称和日志客户端名称来创建的。A virtual log store is created by specifying both the physical log name and the log client name.

共享同一个物理日志名称的客户端将共享相同的范围集合与策略。Clients that share the same physical log name share the same extents collection and policy.

适用于