Recently, I migrated my blog system, which involved Nginx, SSL certificates, a MySQL database, and various WordPress files. After quite a bit of effor[......] 继续阅读
Recently, I migrated my blog system, which involved Nginx, SSL certificates, a MySQL database, and various WordPress files. After quite a bit of effor[......] 继续阅读
最近将博客系统迁移,有 Nginx,ssl证书,mysql数据库和 wordpress 各类文件,折腾了一番。 为了避免后续服务器故障等问题,在家里启动树莓派,对博客所在的服务器使用 rsync 做定期备份。 树莓派使用自带的 cron 服务,做定期启动任务。 打开 /etc/cron.d 目录,然[......] 继续阅读
Installed Mysql/MariaDB, but I cannot log in as root; I can only use the mysql account to get in. [root@192-168-0-241 ~]# mysql -u mysql Welcome to th[......]继续阅读
安装了 Mysql/MariaDB ,但是 root 死活进不去,只能用 mysql 这个账号进去。 [root@192-168-0-241 ~]# mysql -u mysql Welcome to the MariaDB monitor. Commands end with ; or \g.[......]继续阅读
reflect.Type.Elem() 可以返回元素的类型,例如指针类型,返回不带指针的类型。 reflect.Value.Elem() 是获取指向值的引用。 type name struct { } func (n name) Print(str string) { } func main([......]继续阅读
reflect.Type.Elem() can return the type of the element, for example, for pointer types, it returns the type without the pointer. reflect.Value.Elem()[......] 继续阅读
代码所示,将 Table 导出为 .csv 格式的数据。 public static async Task SaveCSV(DataTable dt,string[] header, string fileName) { StringBuild[......]继续阅读
The code provided exports a DataTable to a .csv format. public static async Task SaveCSV(DataTable dt,string[] header, string fileName)[......]继续阅读
继承 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() {[......]继续阅读
Middleware example: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Tex[......]继续阅读
中间件示例: using AuthCenter.Domain.Modules; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text; using Syst[......]继续阅读