写什么呢 前段时间使用 C# 写了个项目,使用 Kubernetes API Server,获取信息以及监控 Kubernetes 资源,然后结合 Neting 做 API 网关。 体验地址 http://neting.whuanle.cn:30080/ 账号 admin,密码 admin123 [......] 继续阅读
写什么呢 前段时间使用 C# 写了个项目,使用 Kubernetes API Server,获取信息以及监控 Kubernetes 资源,然后结合 Neting 做 API 网关。 体验地址 http://neting.whuanle.cn:30080/ 账号 admin,密码 admin123 [......] 继续阅读
What to Write Not long ago, I wrote a project using C#, which utilizes the Kubernetes API Server to retrieve information and monitor Kubernetes resour[......] 继续阅读
关于 Neting 刚开始的时候是打算使用微软官方的 Yarp 库,实现一个 API 网关,后面发现坑比较多,弄起来比较麻烦,就放弃了。目前写完了查看 Kubernetes Service 信息、创建 Route 和 Cluster 和绑定 Kubernetes Service。简单来说,就是完成了[......] 继续阅读
About Neting Initially, I planned to use Microsoft's official Yarp library to implement an API gateway, but later found it quite cumbersome and decide[......] 继续阅读
||其代码如下: /// <summary> /// 值类型和字符串互转 /// </summary> public class JsonStringToNumberConverter : JsonConverterFactory {[......]继续阅读
/// <summary> /// Convert between value types and strings /// </summary> public class JsonStringToNumberConverter : JsonCo[......]继续阅读
The poisoned code is as follows: void Main() { Value a = 0; if (a == 1 && a == 2 && a == 3) { Console.WriteLine("毒代码");[......]继续阅读
The code provided exports a DataTable to a .csv format. public static async Task SaveCSV(DataTable dt,string[] header, string fileName)[......]继续阅读
代码所示,将 Table 导出为 .csv 格式的数据。 public static async Task SaveCSV(DataTable dt,string[] header, string fileName) { StringBuild[......]继续阅读
继承 IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// 状态码 /// </summ[......]继续阅读
Inheriting from IActionResult: public class ResponseResult<TData> : IActionResult { /// <summary> /// Status code[......]继续阅读
There are readers suggesting to use app.UseExceptionHandler(); for global exception interception. https://learn.microsoft.com/en-us/aspnet/core/fundam[......] 继续阅读
有读者回复推荐全局异常拦截使用 app.UseExceptionHandler();。 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-9.0 跟本身的主要区别是请求到[......] 继续阅读
Directly use the .NET CLR library for generation without relying on third-party frameworks. The code has been updated to the latest implementation, re[......] 继续阅读
直接使用 .NET 的 CLR 库生成,不依赖第三方框架。 已将代码修正为最新实现,去掉过时接口。 基于密码的密钥导出函数2(PBKDF2)让别人更难通过穷举法猜到你的帐户密码。 pbkdf2 加密是不可逆的,因此可以用来处理密码等,只能对比,不能还原。 比如说,每个用户设置一个加密密钥,每个用户使[......] 继续阅读
When directly using the API to get a Claim, the correctness of the Token's key is not checked. var jwt = jwtSecurityTokenHandler.ReadJ[......]继续阅读
当直接使用 API 获取 Claim 时,是不会检查 Token 的密钥是否正确的。 var jwt = jwtSecurityTokenHandler.ReadJwtToken(token); 如果要同时检查 Token,则可以这样使用: [......]继续阅读
Common JSON serialization configuration is as follows: // JSON serialization configuration private static readonly JsonSerializerOpti[......]继续阅读
常用的 Json 序列化配置如下: // json 序列化配置 private static readonly JsonSerializerOptions JsonSetting = new JsonSerializerOptions() {[......]继续阅读