摘要: .NET Core 文件 文件夹操作 /// <summary> /// 文件夹 文件管理 /// /// 会有一些在开发环境/测试环境/生产环境 不同, /// 数据库连接--路径--开关 /// 配置文件:不用改代码编译 /// /// 配置路径:绝对路径 /// 相对路径 / 然后拼装 /// 阅读全文
posted @ 2022-01-20 10:47 AingHub 阅读(941) 评论(0) 推荐(0)
摘要: ServiceStack,默认现在 6000 次每小时 破解方法: 下载路径https://github.com/ServiceStack/ServiceStack.Text 找到 LicenseUtils 类: 源代码 public const int RedisRequestPerHour = 阅读全文
posted @ 2022-01-19 14:42 AingHub 阅读(245) 评论(0) 推荐(0)
摘要: 一、使用默认 IOC 注入 1. 方式一 系统 IOC 注入:Startup 类 ConfigureServices 方法中添加以下代码 services.AddTransient<RedisStringService>(); services.AddTransient<RedisListServi 阅读全文
posted @ 2022-01-19 10:00 AingHub 阅读(811) 评论(0) 推荐(1)
摘要: SqlHelper工具类(实现添加、查询) public class SqlHelper { private static string ConnectionStringCustomers = ConfigurationManager.ConnectionStrings["Customers"].C 阅读全文
posted @ 2022-01-18 16:20 AingHub 阅读(497) 评论(0) 推荐(0)
摘要: 方法一.自定义中间件全局方式 在 Setup.cs 类中的 Configure 管道方法中添加 #region 自定义支持跨域 //支持跨域 任何一个请求都会执行库员 Func<RequestDelegate, RequestDelegate> customcores = next => { ret 阅读全文
posted @ 2022-01-14 09:53 AingHub 阅读(196) 评论(0) 推荐(0)
摘要: 1.工具类 using RabbitMQ.Client; using RabbitMQ.Client.Events; using System; using System.Collections.Generic; using System.Linq; using System.Text; using 阅读全文
posted @ 2022-01-13 11:10 AingHub 阅读(52) 评论(0) 推荐(0)
摘要: RSA加密解密 Nuget 引入 XC.RSAUtil 博客园参考文章1 生成公私钥对 // 生成公私钥对 // XML Console.WriteLine(RsaKeyGenerator.XmlKey(2048)[0]); Console.WriteLine("++++++++++++++++++ 阅读全文
posted @ 2022-01-13 09:55 AingHub 阅读(117) 评论(0) 推荐(0)
摘要: //数据帧的解析代码: static string byteToString(byte[] buffer, int count, Socket client) { int type = buffer[0] & 0xF; if (type == 0x1) //文本 { int mask = buffe 阅读全文
posted @ 2022-01-13 09:40 AingHub 阅读(225) 评论(0) 推荐(0)
摘要: 生成18位订单号 DateTime.Now.ToUniversalTime().Ticks - 537525800000000000 示例值 100000064399971543 获取时间错(秒) (DateTime.Now.ToUniversalTime().Ticks - 62135596800 阅读全文
posted @ 2022-01-13 09:37 AingHub 阅读(2879) 评论(0) 推荐(0)
摘要: using System; using System.Text; using System.Text.RegularExpressions; using System.Web; public class VerificationHelper { /// <summary> /// 检测用户名格式是否 阅读全文
posted @ 2022-01-13 09:35 AingHub 阅读(87) 评论(0) 推荐(0)