一款简单易用的基础网络通讯组件库。

FileStorage 类

简化版文件存储器。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.1.4.7+7f7e1f78093c99347956e09330d5d7aca1d2bdf2
C#
public sealed class FileStorage : IDisposable
Inheritance
Object    FileStorage
Implements
IDisposable

属性

CanRead 获取一个值,指示是否可以读取文件。
CanSeek 获取一个值,指示是否可以查找文件位置。
CanWrite 获取一个值,指示是否可以写入文件。
Length 获取文件长度。
Path 获取文件路径。

方法

DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
Flush 刷新缓冲区。
FlushAsync 异步刷新缓冲区。
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
Read(Int64, SpanByte) 读取数据。
Read(Int64, Byte, Int32, Int32) 读取数据。
ReadAsync 异步读取数据。
SetLength 设置文件长度。
ToStringReturns a string that represents the current object.
(继承自 Object。)
Write(Int64, ReadOnlySpanByte) 写入数据。
Write(Int64, Byte, Int32, Int32) 写入数据。
WriteAsync 异步写入数据。

扩展方法

SafeDispose 安全性释放(不用判断对象是否为空)。不会抛出任何异常。
(由 SystemExtension 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见