上一页 1 2 3 4 5 6 7 8 9 10 ··· 28 下一页
摘要: 实体类 ///<summary> /// ///</summary> [SugarTable("Student")] public partial class Student { public Student(){ } /// <summary> /// Desc: /// Default: /// 阅读全文
posted @ 2022-07-10 21:46 码农阿亮 阅读(1467) 评论(1) 推荐(0) 编辑
摘要: 三种方式 ConnectionConfig config = new ConnectionConfig() { ConnectionString = "Data Source=DESKTOP-VF73RDU;Initial Catalog=CustomerDBCodeFirst;Persist Se 阅读全文
posted @ 2022-07-10 21:34 码农阿亮 阅读(1007) 评论(1) 推荐(0) 编辑
摘要: 帮助类 [HtmlTargetElement("Paging")] public class PagerTagHelper : TagHelper { /// <summary> /// 数据总数,默认为0条 /// </summary> public int Total { get; set; } 阅读全文
posted @ 2022-07-10 21:11 码农阿亮 阅读(97) 评论(0) 推荐(0) 编辑
摘要: **简介:**SqlSugar提供了完整的解决方案,只需要配置,他可以帮助自动分表,自己帮助管理表关系,我们只需要考虑业务,不需要去考虑分表后的问题;接下来,通过SqlSugar实现对数据库实现按时间实现分表 一、实体类设计 必须通过特性指定实体类分表方式以及按照哪个字段分表 [SplitTable 阅读全文
posted @ 2022-07-10 21:06 码农阿亮 阅读(4508) 评论(0) 推荐(0) 编辑
摘要: **描述:**当程序在在运行时,如何能动态的进行拓展,在不停止程序运行的情况下,通过添加数据库链接到配置文件,实现查询级别的负载均衡?接下来通过一个简单的配置 一、读取配置文件类 public class ConnectionConfigManager { private static Connec 阅读全文
posted @ 2022-07-10 20:30 码农阿亮 阅读(810) 评论(0) 推荐(0) 编辑
摘要: 一、读写分离 配置数据库链接 注意:这里主从库需要在数据库中进行配置,使从库始终同步主库中的数据,保持数据一致性 //准备从库链接 var connetctionlist = new List<SlaveConnectionConfig>() { //第一个从库 new SlaveConnectio 阅读全文
posted @ 2022-07-10 19:59 码农阿亮 阅读(951) 评论(0) 推荐(0) 编辑
摘要: 一、准备 项目中通过Nuget 引入程序集--SQlSugarCore 二、创建以及初始化数据库链接对象 支持多种数据库类型,根据应用的数据库类型,可进行修改 ConnectionConfig connectionConfig = new ConnectionConfig() { DbType = 阅读全文
posted @ 2022-07-10 19:26 码农阿亮 阅读(1325) 评论(0) 推荐(0) 编辑
摘要: EF常用命令 数据库迁移 Add-Migration [标识名] 当前所有上下文 Add-Migration [标识名] -c [数据库上下文名称] -o [迁移文件存放目录] 迁移指定上下文 更新迁移到数据库 update -database 更新当前所有上下文 update -database 阅读全文
posted @ 2022-07-09 13:04 码农阿亮 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 一、学习文档 胖哥Docker胎教教程 docker教程全解 二、学习踩坑 1.报错WSL 2 installation is incomplete的问题 更新WSL WSL_UPDATE 卸载DockerDesktop,重新安装 阅读全文
posted @ 2022-07-09 12:54 码农阿亮 阅读(34) 评论(0) 推荐(0) 编辑
摘要: docker命令整理 启动docker systemctl start docker 重启docker systemctl restart docker 停止docker systemctl stop docker 查看docker运行状态 systemctl status docker 开启既启动 阅读全文
posted @ 2022-07-09 12:53 码农阿亮 阅读(20) 评论(0) 推荐(0) 编辑
摘要: class CountdownEventTest { const int numIterations = 10; static CountdownEvent latch1 = new CountdownEvent(1); static void Main() { #region 方式一 //Thre 阅读全文
posted @ 2022-07-04 09:48 码农阿亮 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 字符串转rtf值 //字符串转rtf public string str2Rtf(string s) { string rtfFormattedString = ""; RichTextBox richTextBox = new RichTextBox(); richTextBox.Text = s 阅读全文
posted @ 2022-06-30 17:16 码农阿亮 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 打开文件 ​```C# private void selectFile() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Files|*.png;*.jpg"; // 设定打开的文件类 阅读全文
posted @ 2022-06-30 17:13 码农阿亮 阅读(2333) 评论(0) 推荐(0) 编辑
摘要: public static bool DownLoadFiles(string uri, string filefullpath, int size = 1024) { try { if (File.Exists(filefullpath)) { try { File.Delete(filefull 阅读全文
posted @ 2022-06-30 17:11 码农阿亮 阅读(715) 评论(0) 推荐(0) 编辑
摘要: 等比例压缩 /// <summary> /// 压缩图片 /// </summary> /// <param name="filePath">文件路径</param> /// <param name="height">图像高度</param> /// <returns></returns> publ 阅读全文
posted @ 2022-06-30 17:08 码农阿亮 阅读(422) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 写文件导到磁盘(异步) /// </summary> /// <param name="stream">数据流</param> /// <param name="path">文件路径</param> /// <returns></returns> public s 阅读全文
posted @ 2022-06-30 17:05 码农阿亮 阅读(179) 评论(0) 推荐(0) 编辑
摘要: AES加密与解密 ​ /// <summary> /// AES 加密 /// </summary> /// <param name="str">明文</param> /// <param name="aesKey">密钥</param> /// <returns></returns> public 阅读全文
posted @ 2022-06-30 17:03 码农阿亮 阅读(3819) 评论(0) 推荐(1) 编辑
摘要: /// <summary> /// 随机数 /// </summary> /// <param name="Length">长度</param> /// <returns></returns> public static string GenerateRandomNumber(int Length) 阅读全文
posted @ 2022-06-30 16:56 码农阿亮 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 播放Mp3音频 /// <summary> /// 播放音频, /// 1.添加新引用 COM组件的Microsoft Shell Controls And Automation /// 2.添加成功,引用中显示的为Shell32.dll,、 /// 3.设置Shell32.dll的属性为嵌入互操作 阅读全文
posted @ 2022-06-30 16:52 码农阿亮 阅读(1440) 评论(0) 推荐(0) 编辑
摘要: 计算音频的时长 /// <summary> /// 获取mp3文件的歌曲时间长度 /// </summary> /// <param name="songPath"></param> /// <returns></returns> private string GetMp3Times(string 阅读全文
posted @ 2022-06-30 16:51 码农阿亮 阅读(628) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 28 下一页