随笔分类 - C#
摘要:/// <summary> /// 扩展方法 /// </summary> public static class Extensions { static Extensions() { } /// <summary> /// 将对象序列化成json字符串 /// </summary> /// <pa
阅读全文
摘要:public partial class WeighRecord : Form { WeighRecordSet headsSet = null; public WeighRecord() { InitializeComponent(); this.RecordTimepx.Format = Dat
阅读全文
摘要://方法一 表头调换, 后台调用 this.dataGridView1.Columns["ProductName"].DisplayIndex = 0; //方法二 表头调换,属性设置, 页面上拖拽 this.dataGridView1.AllowUserToOrderColumns = true;
阅读全文
摘要:vs2019 .netcode3.1 using Bps.DTO; using ICSharpCode.SharpZipLib.Zip; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; using S
阅读全文
摘要:C#位数不足补零:int i=10;方法1:Console.WriteLine(i.ToString("D5"));方法2:Console.WriteLine(i.ToString().PadLeft(5,'0'));//推荐方法3:Console.WriteLine(i.ToString("000
阅读全文
摘要:运行环境 .net code 2.2 IFormFileCollection files; var singlefile = files.FirstOrDefault(); //得到流文件,文件名称 singlefile.OpenReadStream(), singlefile.FileName
阅读全文
摘要:官网 地址参考 https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-build 项目根目录下 执行命令 dotnet build --runtime win-x64 位置
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; namespace UDPTes
阅读全文
摘要://项目引用 ffmpeg.exe 下载地址http://ffmpeg.org/ https://www.wowza.com/testplayers var time = DateTime.Now; var minute = 2; //录制分钟 var fileName = Guid.NewGuid
阅读全文
摘要:IOC = Autofac, MQ =ActiveMQ、RabbitMQ , NoSQL= Redis,Memchche,MongoDb , .Net Code Linux 作业调度 =Quartz.NET,Topshelf 设计模式 OOA OOD OOP 高内聚,低耦合 会这些 就满满的技能点
阅读全文
摘要:using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace listTst { class Program { stat...
阅读全文
摘要://(obj)对象string类型 null转空字符串和去前后空格 obj.ObjectNullToString<类名>();
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Console
阅读全文
摘要:var input=new input(); var personList= new List(); //一个查询集合 var Total = personList.Count(s => s.AcceptStatus == input.AcceptStatus); //总记录数 //分页 var pagerList = personList.Where(s => s.AcceptSta...
阅读全文
摘要:{"Exception":{$regex:"定时发送邮件"}} //模糊查询条件 {"DateTime":-1} //排序降序 工具增删改查参考 https://www.cnblogs.com/zhaoyang-1989/p/7066360.html
阅读全文
摘要:var retryTimes = 5; //重试次数 int times = 0; skip: //代码段开始 //处理逻辑 var result=false ; //处理结果 //..... //处理逻辑 //判断 处理结果是否成功, 并且 重试次数是否达到上限 (处理成功,不需要重试,或达到上限次数,不执行 ) if (!resul...
阅读全文
摘要://加载配置文件 var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables(); Con...
阅读全文
摘要:1.MSMQ安装 控制面板-程序和功能-打开或关闭Windows功能-Microsoft Message Queue(MSMQ)服务器,选中所有,点击确定。 2.消息队列的应用场景(转载自http://www.cnblogs.com/stopfalling/p/5375492.html) ①异步处理
阅读全文
摘要:1、单问号(?) 作用:用于给变量设初化的时候,给变量(int类型)赋为null值,而不是0。 例子: public int a; //默认值为0 public int ?b; //默认值为null 参考:http://msdn.microsoft.com/zh-cn/library/1t3y8s4
阅读全文
摘要:对比 准备数据 实体类: 定义: 使用DataContractJsonSerializer 帮助类: 用法: 输出: 使用JavaScriptSerializer 使用Silverlight 使用JSON.NET
阅读全文