XFEExtension
【DLL】XFE各类拓展是一个C#的DLL库,旨在优化C#代码中常用语句的使用,并提供更简洁的访问方式,同时提供Xunit测试框架,快速搭建服务器/客户端,免费ChatGPTAPI接口,免费通讯服务器,XFE下载器,新增格式等
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore/XFEChatGPT/ChatGPTInnerClass/HelperClass/ApiKey.cs
+3
-12
XFEstudio/XFEExtension
api秘钥
b2830fd
代码差异
1 个文件
+3
-12
@@ -22,10 +22,8 @@ public class ApiKey(string aPiKey, string description)
22
22
/// 转换为字符串
23
23
/// </summary>
24
24
/// <returns></returns>
25
public override string ToString()
26
{
27
return $"{{[+-{Description}-+][+-{Key}-+]}}";
28
}
25
public override string ToString() => $"{{[+-{Description}-+][+-{Key}-+]}}";
26
29
27
/// <summary>
30
28
/// 将字符串转换为ApiKey的List
31
29
/// </summary>
@@ -35,14 +33,7 @@ public class ApiKey(string aPiKey, string description)
35
33
{
36
34
var keyGroup = keyString.Split(Separator);
37
35
List<ApiKey> apiKeys = [];
38
foreach (var key in keyGroup)
39
{
40
var oneKey = key.Split(XFEDictionary.EntrySeparator, StringSplitOptions.RemoveEmptyEntries);
41
if (oneKey.Length == 2)
42
{
43
apiKeys.Add(new ApiKey(oneKey[1], oneKey[0]));
44
}
45
}
36
apiKeys.AddRange(from key in keyGroup select key.Split(XFEDictionary.EntrySeparator, StringSplitOptions.RemoveEmptyEntries) into oneKey where oneKey.Length == 2 select new ApiKey(oneKey[1], oneKey[0]));
46
37
return apiKeys;
47
38
}
48
39
}