public TableFile(string fileFullPath, Encoding encoding) { // 不会锁死, 允许其它程序打开 using (FileStream fileStream = new FileStream(fileFullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { var config = new TableFileConfig() { ContentStreams = new Stream[] { fileStream }, }; if (encoding != null) { config.Encoding = encoding; } _config = config; ParseAll(_config); } }
private void ParseAll(TableFileConfig config) { ParseStringsArray(config.Contents); ParseStreamsArray(config.ContentStreams); }
/// <summary> /// 表文件 /// </summary> /// <param name="config">需求读取的数据</param> public TableFile(TableFileConfig config) { _config = config; ParseAll(config); }