XFE各类拓展.NetCore
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package XFE各类拓展.NetCore --version 1.1.1
NuGet\Install-Package XFE各类拓展.NetCore -Version 1.1.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="XFE各类拓展.NetCore" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XFE各类拓展.NetCore --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XFE各类拓展.NetCore, 1.1.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.
// Install XFE各类拓展.NetCore as a Cake Addin #addin nuget:?package=XFE各类拓展.NetCore&version=1.1.1 // Install XFE各类拓展.NetCore as a Cake Tool #tool nuget:?package=XFE各类拓展.NetCore&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
XFEExtension (XFE各类拓展)
描述
XFEExtension是一个C#的DLL库,旨在优化C#代码中常用语句的使用,并提供更简洁的访问方式,以便在快速开发C#项目时提高代码的可读性和简洁性。且提供了免费的ChatGPT代码API访问
用途
XFEExtension库适用于各种C#项目,特别适合在需要提高代码可读性的情况下使用。它包含了许多常见操作的拓展方法,使得代码编写更加高效和简便。以下是一些XFEExtension的用途示例:
简化代码访问: XFEExtension提供了更简洁的语法,使得代码中的访问操作更加清晰和易读。
优化性能: 通过使用XFEExtension,您可以执行各种性能优化操作,提高应用程序的效率。
加速开发: 通过减少样板代码,XFEExtension可以加速项目的开发过程,同时提高代码的可维护性。
示例(使用前记得进行相应的引用)
以下是一些使用XFE各类拓展的示例:
XFE的ChatGPT使用示例
最简单的用法
//询问GPT并接收回复
var result = await XFEChatGPT.SendAndGetGPTResponse("你好");
Console.WriteLine(result);
一般用法
//使用XFEChatGPT类来进行GPT的交互
XFEChatGPT xFEChatGPT = new XFEChatGPT("你是一个人工智能AI", true);
//订阅事件
xFEChatGPT.XFEChatGPTMessageReceived += (sender, e) =>
{
switch (e.GenerateState)
{
case GenerateState.Start:
Console.Write("【输出开始】ChatGPT:");
break;
case GenerateState.Continue:
Console.Write(e.Message);
break;
case GenerateState.End:
Console.WriteLine("【输出完成】");
break;
case GenerateState.Error:
Console.WriteLine($"【发生错误】{e.Message}");
break;
default:
break;
}
};
//输入询问内容
var askContent = Console.ReadLine();
//发送生成随机ID并询问内容
xFEChatGPT.SendGPTMessage(Guid.NewGuid().ToString(), askContent);
推荐用法
//创建有记忆功能的XFEChatGPT对象
MemorableXFEChatGPT memorableXFEChatGPT = new MemorableXFEChatGPT();
//创建一个新的对话并设置System内容
memorableXFEChatGPT.CreateDialog("新的对话ID", "你是一个由寰宇朽力网络科技开发的人工智能AI", true, true);
//订阅消息接收事件
memorableXFEChatGPT.XFEChatGPTMessageReceived += (sender, e) =>
{
switch (e.GenerateState)
{
case GenerateState.Start:
Console.Write("【输出开始】ChatGPT:");
break;
case GenerateState.Continue:
Console.Write(e.Message);
break;
case GenerateState.End:
Console.WriteLine("【输出完成】");
break;
case GenerateState.Error:
Console.WriteLine($"【发生错误】{e.Message}");
break;
default:
break;
}
};
//读取询问内容
var askContent = Console.ReadLine();
//填写之前创建的对话ID,生成随机的消息ID,并输入刚刚读取的询问内容
memorableXFEChatGPT.AskChatGPT("新的对话ID", Guid.NewGuid().ToString(), askContent);
IO流拓展操作示例
// 使用XFEExtension来简化文件读取/写入操作
"Hello World!".WriteIn("test.txt");
string txt = "test.txt".ReadOut();
XEA加密算法示例
// 使用XFE各类拓展来进行加密操作
string text = "这是一段将要加密的文本";
$"未加密内容:{text}".CW();
string password = "这是一个秘钥";
string encrypt = text.XEAEncrypt(password);//加密
Console.WriteLine("加密内容:" + encrypt);
Console.WriteLine("解密内容:" + encrypt.XEADecrypt(password));//解密
特性操作示例
// 使用XFE各类拓展来简化特性读取操作
string str = testObject.GetAttribute<string>();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on XFE各类拓展.NetCore:
Package | Downloads |
---|---|
XFE各类拓展.NetCore.XUnit
提供方便快捷的测试,无需编写Main方法,可直接添加特性在类或方法上进行测试 |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.7.6 | 144 | 3/7/2024 | |
1.7.5 | 111 | 3/6/2024 | |
1.7.4 | 116 | 3/6/2024 | |
1.7.3 | 86 | 3/6/2024 | |
1.7.2 | 91 | 3/6/2024 | |
1.7.1 | 106 | 3/6/2024 | |
1.7.0 | 90 | 3/5/2024 | |
1.6.3 | 113 | 3/5/2024 | |
1.6.2 | 95 | 2/14/2024 | |
1.6.1 | 131 | 2/13/2024 | |
1.6.0 | 107 | 2/12/2024 | |
1.5.3 | 125 | 2/11/2024 | |
1.5.2 | 123 | 2/10/2024 | |
1.5.1 | 119 | 2/10/2024 | |
1.5.0 | 110 | 2/6/2024 | |
1.4.1 | 123 | 1/7/2024 | |
1.4.0 | 101 | 1/6/2024 | |
1.3.2 | 120 | 1/6/2024 | |
1.3.1 | 111 | 1/5/2024 | |
1.3.0 | 110 | 1/5/2024 | |
1.2.3 | 204 | 12/8/2023 | |
1.2.2 | 106 | 12/5/2023 | |
1.1.1 | 114 | 12/4/2023 | |
1.1.0 | 114 | 12/3/2023 |
修改markdown文件说明
新增XFE下载器
修改ChatGPT对接的部分协议
优化部分代码结构