ExcelConfig 1.0.3.13
dotnet add package ExcelConfig --version 1.0.3.13
NuGet\Install-Package ExcelConfig -Version 1.0.3.13
<PackageReference Include="ExcelConfig" Version="1.0.3.13" />
<PackageVersion Include="ExcelConfig" Version="1.0.3.13" />
<PackageReference Include="ExcelConfig" />
paket add ExcelConfig --version 1.0.3.13
#r "nuget: ExcelConfig, 1.0.3.13"
#:package ExcelConfig@1.0.3.13
#addin nuget:?package=ExcelConfig&version=1.0.3.13
#tool nuget:?package=ExcelConfig&version=1.0.3.13
ExcelConfig
ExcelConfig Is a quick tool to operate Excel for arbitrary configuration.
ExcelConfig 是一个基于 .NET 的轻量级库,帮助您快速配置 .config.xlsx
格式配置文件的库。对 Excel 文件进行配置管理,它允许开发者将应用程序的配置信息存储在 Excel 表格中,并提供便捷的 API 来读取和写入这些配置。
📃 示例配置文件 Sample configuration file
🔗 配置存储中心 Configure storage center
🔗 配置存储中心 Storage center API Nuget库
Configuration
AppConfig
public static string Text(string key) public static void WriteText(string key, string value) public static decimal Number(string key) public static string[] Array(string key) public static bool YesOrNo(string key) public static void WriteYesOrNo(string key, bool value)
AppConfigFile
public AppConfigFile(string path = "", string name = "")
ExcelFile
public static ExcelFile Load(string path, string sheet) public void ToSheet(string sheetname) public void SetKeyField(string fieldName) public void SetValueField(string fieldName) public string Text(string name) public decimal Number(string name) public bool YesOrNo(string name) public string[] Array(string name) public SheetLine ReadLine(string key) public IEnumerable<SheetLine> ReadAllLine() public CellObj Read(int rowno, int colno) // start 1 not 0 public CellObj Read(string colname)
ExcelConfigFile
public ExcelConfigFile(string filepath = "", string name = "", string suffix = "")
SheetLine
public string Text(string name) public decimal Number(string name) public bool YesOrNo(string name) public string[] Array(string name)
GlobalSetting #参数定义
public static string YES = "是的"; public static string NO = "不是"; /// <summary> /// 数组分割符 /// </summary> public static char ArraySplitChar = ';'; public static string SHEET_Global = "全局"; public static string CONFIG_DEFAULT = "app"; public static string CONFIG_SUFFIX = ".config.xlsx"; public static string FIELD_ExtraConfigPath = "额外配置目录"; public static string SHEET_ExtraConfig = "额外配置目录"; public static string COLUMN_KEY = "名称"; public static string COLUMN_VALUE = "值"; /// <summary> /// 全局配置文件路径,,默认类库所在目录 /// * 您需要确认配置的目录存在,不存在需要先行创建 /// </summary> public static string CONFIG_PATH = string.Empty;
🍕 Template
xlsx template file related operations, the main function is to replace the specified cell and output the specified format table.
xlsx
模板文件相关操作, 主要功能为替换指定单元格 和 输出指定格式表格。
ExcelTemplateFile
public void TemplateOut(object obj, string path)
📦 特性
- Excel 配置读取:支持从 Excel 文件中读取配置信息。
- 多配置支持:可以管理多个配置文件,并通过名称或键来访问。
- 类型安全读取:支持以类型安全的方式读取配置值(如字符串、数字、布尔值、数组等)。
- 全局配置与局部配置:支持全局配置项以及多个独立的配置块。
- 配置写入:支持将配置值写回 Excel 文件。
- 模板支持:提供基于 Excel 模板生成配置文件的功能。
📁 项目结构
ExcelConfig
:核心配置类,提供读写 Excel 配置的方法。ExcelFile
:封装对 Excel 文件的操作,支持切换工作表和字段。AppConfig
:提供静态方法访问默认配置。ExcelTemplateFile
:支持通过 Excel 模板生成配置文件。ExcelRow
和SheetLine
:用于表示 Excel 中的行数据。ExcelRead
:提供从 Excel 读取数据的功能。GlobalSetting
:定义全局常量和配置参数。
本项目基于开源项目 MiniExcel 1.41.2
Apache License 2.0
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ExcelConfig:
Package | Downloads |
---|---|
ExcelConfig.StoreAPI
config store server apis. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.3.13 | 11 | 8/6/2025 |
1.0.3.12 | 60 | 8/1/2025 |
1.0.3.11 | 437 | 7/24/2025 |
1.0.3.10 | 436 | 7/24/2025 |
1.0.3.9 | 139 | 6/19/2025 |
1.0.3.8 | 186 | 6/17/2025 |
1.0.3.7 | 336 | 6/11/2025 |
1.0.3.6 | 138 | 6/4/2025 |
1.0.3.5 | 134 | 5/30/2025 |
1.0.3.4 | 139 | 5/29/2025 |
1.0.3.3 | 155 | 5/9/2025 |
1.0.3.2 | 106 | 2/25/2025 |
1.0.3 | 104 | 2/25/2025 |
1.0.2 | 111 | 2/17/2025 |
1.0.1 | 116 | 11/28/2024 |
1.0.0 | 123 | 11/15/2024 |