随笔分类 -  .net / .net 基础

摘要:没转化之前: public class ShopSpecialTimeExtParams { public int ShopId { get; set; } public List<SpecialTimeExtItem> TimeExts { get; set; } } public class S 阅读全文
posted @ 2024-12-09 15:32 龙卷风吹毁停车场 阅读(20) 评论(0) 推荐(0) 编辑
摘要:long timestamp1 = DateTimeOffset.Now.ToUnixTimeMilliseconds(); //获取当前时间戳13位 毫秒. long timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); //获取当前时间戳1 阅读全文
posted @ 2024-11-28 11:12 龙卷风吹毁停车场 阅读(112) 评论(0) 推荐(0) 编辑
摘要:appsettings.json 文件内容: { "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "MyConfigKey": "MyConfigValue", " 阅读全文
posted @ 2024-09-20 17:28 龙卷风吹毁停车场 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1. 选择右侧项目文件,单机右键,选择"编辑项目文件",打开如下 <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> //<Nullable>enable</N 阅读全文
posted @ 2024-08-05 11:08 龙卷风吹毁停车场 阅读(16) 评论(0) 推荐(0) 编辑
摘要:读取单个配置 举例: 获取mes的内容 第一种方式: 使用IConfiguration app.MapGet("/test", (IConfiguration configuration) => { return configuration["mes"]; }); 第二种,getvalue获取 ap 阅读全文
posted @ 2024-08-04 17:53 龙卷风吹毁停车场 阅读(92) 评论(0) 推荐(0) 编辑
摘要:在启动项 Program.cs 文件中添加 //app.UseStaticFiles(); // 启动静态文件中间件,默认访问wwwroot app.UseStaticFiles(new StaticFileOptions() { //修改默认访问地址为MyStaticFiles文件 FilePro 阅读全文
posted @ 2024-08-04 17:16 龙卷风吹毁停车场 阅读(2) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 生成树形结构 /// </summary> public void GetTreeNode() { //SqlHelper.GetSqlDataReader是封装的查询数据库语句,可根据自己需求封装 //假设获取所有一级节点 List<Products> prod 阅读全文
posted @ 2024-07-02 16:11 龙卷风吹毁停车场 阅读(16) 评论(0) 推荐(0) 编辑
摘要:1.安装nuget SkiaSharp2.创建 VerifyCodeHelper帮助类 using SkiaSharp; namespace WebApplication3 { public class VerifyCodeHelper { /// <summary> /// 获取图像数字验证码 / 阅读全文
posted @ 2024-06-26 18:49 龙卷风吹毁停车场 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2024-06-21 20:31 龙卷风吹毁停车场 阅读(7) 评论(0) 推荐(0) 编辑
摘要:private void button1_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); //选择图片(*.png,*.jpg,*.gft) 是title提示 //*.png;*.jpg;* 阅读全文
posted @ 2024-06-21 10:52 龙卷风吹毁停车场 阅读(12) 评论(0) 推荐(0) 编辑
摘要:在这点我们需要使用到的sql语句 语法: update 表名 set 某个值=case when @你要修改的值 > 表中的某一个值 then 成立之后要设置的值 else 前面没有成立设置的值 end 举例: 我根据传入的年龄age来设置type为1还是0,1表示成年,0表示未成年 update 阅读全文
posted @ 2024-06-19 16:15 龙卷风吹毁停车场 阅读(35) 评论(0) 推荐(0) 编辑
摘要:this.nian.Text = DateTime.Now.Year.ToString(); //获取年 this.yue.Text = DateTime.Now.Month.ToString(); //获取月 this.ri.Text = DateTime.Now.Day.ToString(); 阅读全文
posted @ 2024-06-13 23:13 龙卷风吹毁停车场 阅读(51) 评论(0) 推荐(0) 编辑
摘要:public static class Verify { /// <summary> /// 验证手机号码 /// </summary> /// <param name="str_handset"></param> /// <returns></returns> public static bool 阅读全文
posted @ 2024-06-11 19:44 龙卷风吹毁停车场 阅读(57) 评论(0) 推荐(0) 编辑
摘要:使用 : 注意: 用guid做主键时,不能把主键设置为聚集索引,因为聚集索引是按照顺序保存主键的,因此用guid作为主键性能差 Guid g = Guid.NewGuid(); Console.WritLine(g.ToString()); 阅读全文
posted @ 2024-05-30 13:23 龙卷风吹毁停车场 阅读(13) 评论(0) 推荐(0) 编辑
摘要:using System; namespace ConsoleApp1 { public class Program { /* 静态方法 (static): 特点: 1.生命周期,一旦创建--应用结束才会销毁 2.可全局使用 3.效率高 用处: 用户登陆信息,系统配置信息,系统设置,SqlHelpe 阅读全文
posted @ 2024-05-25 11:41 龙卷风吹毁停车场 阅读(49) 评论(0) 推荐(0) 编辑
摘要:1.在父窗体中定义和声明委托 2.将方法赋值给委托变量 3.将变量传递给子窗体 4.子窗体接受父窗体传递的委托,并调用 阅读全文
posted @ 2024-05-23 08:37 龙卷风吹毁停车场 阅读(10) 评论(0) 推荐(0) 编辑
摘要:目录结构 定义泛型反射 ToModel.cs文件 using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threadi 阅读全文
posted @ 2024-05-22 22:13 龙卷风吹毁停车场 阅读(10) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示