JCoder.CoreKits.NoteTxt 3.2623.1

dotnet add package JCoder.CoreKits.NoteTxt --version 3.2623.1
                    
NuGet\Install-Package JCoder.CoreKits.NoteTxt -Version 3.2623.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JCoder.CoreKits.NoteTxt" Version="3.2623.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JCoder.CoreKits.NoteTxt" Version="3.2623.1" />
                    
Directory.Packages.props
<PackageReference Include="JCoder.CoreKits.NoteTxt" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JCoder.CoreKits.NoteTxt --version 3.2623.1
                    
#r "nuget: JCoder.CoreKits.NoteTxt, 3.2623.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JCoder.CoreKits.NoteTxt@3.2623.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JCoder.CoreKits.NoteTxt&version=3.2623.1
                    
Install as a Cake Addin
#tool nuget:?package=JCoder.CoreKits.NoteTxt&version=3.2623.1
                    
Install as a Cake Tool

JCoder.CoreKits.NoteTxt

目录

[TOC]

一.架构说明

JCoder.CoreKits.NoteTxt
语言 C#
协议 MIT
.Net框架 .Net Standard2.1; .Net Framework 4.7.2; .Net 6; .Net 8; .Net 10;
简述 一款使用本地Txt文件进行辅助的工具库。

1.1 引用类库

引用类库 版本
- -

1.2 相关类库

| 相关类库 | 说明 | | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | JCoder | The base library of JCoder Serial.(JCoder库系列的基础库。) | | JCoder.CoreKits | A simple library for C# extension.(一款简易的用于C#的扩展库。) | | JCoder.Text4Net | A simple library for text.(一款简易的用于文本处理的扩展库。) |

获取方式

  1. 版本要求:>=2.1
  2. 以版本2.1为例

| 获取方式 | 描述 | | ------------------ | -------------------------------------------- | | Package Manager | Install-Package JCoder.CoreKits.NoteTxt -Version 2.1 | | .Net CLI | dotnet add package JCoder.CoreKits.NoteTxt --version 2.1 | | PackageReference | <PackageReference Include="JCoder.CoreKits.NoteTxt" Version="2.1" /> | | Paket CLI | paket add JCoder.CoreKits.NoteTxt --version 2.1 | | Script&Interactive | #r "nuget: JCoder.CoreKits.NoteTxt, 2.1"| | Cake | // Install JCoder.CoreKits.NoteTxt as a Cake Addin<br/>#addin nuget:?package=JCoder.CoreKits.NoteTxt&version=2.1<br/><br/>// Install JCoder.CoreKits.NoteTxt as a Cake Tool<br/>#tool nuget:?package=JCoder.CoreKits.NoteTxt&version=2.1 |

三.使用说明

本库将文本历史记录保存到本地 Txt 文件(每行一条 JSON 记录),提供基于文本文件的历史数据存储器。

3.1 主要类与接口

| 名称 | 类型 | 描述 | | ---------------------- | ------ | -------------------------------------------------------------------------------- | | NoteTxtHistorian | 类 | 历史数据存储器(NoteTxt),实现 IHistorian,将文本历史记录保存到本地 Txt 文件。 | | BaseNoteTxtTool | 类 | 基础工具(NoteTxt),提供文件夹路径、文件名与 Txt 文件读写。 |

3.2 使用方法

  1. 使用 NoteTxtHistorian 保存历史数据
using JCoder.CoreKits.NoteTxt;

// 创建历史存储器(默认保存到 程序目录\Temps\NoteTxt\ 下的 Txt 文件)
var _historian = new NoteTxtHistorian();

// 自定义保存目录(可选)
_historian.FolderPath = @"D:\Notes";

// 保存单条文本记录(key-value 方式)
_historian.SaveText("lastUser", "Jack");

// 读取单条文本记录
string _user = _historian.GetText("lastUser"); // "Jack"

// 向分组追加记录
_historian.AddGroupTexts("sensor1", "温度=25.6");
_historian.AddGroupTexts("sensor1", "湿度=60%");

// 读取分组记录列表
var _records = _historian.GetGroupTexts("sensor1");
foreach (var _record in _records)
{
    Console.WriteLine(_record);
}
  1. 保存泛型记录
using JCoder.CoreKits.NoteTxt;

public class MyRecord : IHistoryRecord
{
    public string Key { get; set; }
    public string Name { get; set; }
    public DateTime CreationTime { get; set; }
}

var _historian = new NoteTxtHistorian();

// 保存(Key 为空时自动生成)
var _record = new MyRecord { Name = "示例" };
_historian.Save(_record);

// 读取
var _get = _historian.Get<MyRecord>(_record.Key);

// 删除
_historian.Delete<MyRecord>(_record.Key);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 is compatible.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.2623.1 90 9/28/2026

Please contact Jackie by QQ 1378071853 or E-mail JackieLaw-dev@outlook.com;