随笔分类 - .net
摘要:定义模型: namespace House.Models.PublicClass { /// <summary> /// 城市 /// </summary> public class Province { /// <summary> /// 城市编号 /// </summary> /// [Key]
阅读全文
摘要:后端接口返回文件 [Authorization] //给下载模版添加权限 [HttpGet] public IActionResult DownloadTemplate() { //AppContext.BaseDirectory 用于获取项目根目录 var filePath = $"{AppCon
阅读全文
摘要:没转化之前: public class ShopSpecialTimeExtParams { public int ShopId { get; set; } public List<SpecialTimeExtItem> TimeExts { get; set; } } public class S
阅读全文
摘要:long timestamp1 = DateTimeOffset.Now.ToUnixTimeMilliseconds(); //获取当前时间戳13位 毫秒. long timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); //获取当前时间戳1
阅读全文
摘要:第一步: 下载安装redis服务端1.网盘地址: 链接:https://pan.baidu.com/s/1lUQMTSb1laFfoSbN9Z85lw?pwd=pvmd 提取码:pvmd 2.官网自行下载: https://redis.io/downloads/ 第二步: 下载安装redis 可视化
阅读全文
摘要:FileName.cs文件 namespace ZHAOXI.DBHlper { class FileName { public void Show<T, W, Q>(T t, W w, Q q) { Console.WriteLine("这里是" + this.GetType().Name + "
阅读全文
摘要:文件目录: SqlServerDBHlper.cs文件内容: using System.Xml.Linq; namespace ZHAOXI.DBHlper { public class SqlServerDBHlper { public SqlServerDBHlper() { Console.W
阅读全文
摘要:[HttpGet] public void Info() { //获取到token var token = HttpContext.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last(); //解析token信息 va
阅读全文
摘要:环境准备: 安装 net8 运行时 https://dotnet.microsoft.com/zh-cn/download/dotnet/8.0 第一步:安装IIS 第二步: 安装完成后,打开IIS管理器 第三步: 部署后端api服务1.选择网站右键 "添加网站" 2, 点击确定添加3.添加完成后,
阅读全文
摘要:using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Primitives; using System.Collections.Generic; [ApiController] [Route("[controller]")] publi
阅读全文
摘要:举例: A,B类 public class A { public int id {get;set;} public string name {get;set;} public string phone {get;set;} } public class B { public int age {get
阅读全文
摘要:appsettings.json 文件内容: { "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "MyConfigKey": "MyConfigValue", "
阅读全文
摘要:builder.Services.AddSwaggerGen(option => { typeof(ApiVersion).GetEnumNames().ToList().ForEach(version => { option.SwaggerDoc(version, new OpenApiInfo(
阅读全文
摘要:官网下载地址: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads然后下载它: 然后,看这位博主的,我就懒得写了https://www.bilibili.com/read/cv35599692/
阅读全文
摘要:[FromRoute(Name="名字")],捕捉的值会被自动赋值给Action中同名的参数;如果名字不一致,可以用[FromRoute(Name="名字")] //前端传入export async function workOrderWithdrawApprove() { return reque
阅读全文
摘要:IO Directory.Exists(path) //判断文件夹是否存在 Directory.CreateDirectory(path) // 根据路径创建出文件夹 File.Exists(path) //判断文件是否存在 Path.Combine(path, info.text) //路径拼接
阅读全文
摘要:<Window x:Class="wpf.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xa
阅读全文
摘要:Directroy.CreateDirectoy(System.IO) //方法 举例: 判断根目录是否存在wwwroot文件,如果不存在就在根目录创建一个wwwroot文件 var path = $"{AppContext.BaseDirectory}/wwwroot" if(!Directroy
阅读全文

浙公网安备 33010602011771号