最新(发布|更新)

C# 雪花算法源码
算法/数据处理

C# 雪花算法源码

2459

public class IdWorker{ //机器ID private static long workerId; private static long twepoch = 0L; //唯一时间,这是一个避免重复的随机量,自行设定不要大于当前时间戳 private static long sequence = 0L; private static int workerIdBits = 4; //…

.net Core在windows注册服务,并开机启动
.Net Core

.net Core在windows注册服务,并开机启动

8060

在这里我用的是nssm 下载地址http://www.nssm.cc/download 1、下载后解压 我在这里是解压到D:\2\这个目录 2、运行CMD 有的电脑要管理员权限运行cmd 3、cmd 移到 d:\2\这个目录 cd /d d:\2\ 4、运行命令 nssm install lqwvje //lqwvje 是要注册的…

C#, .Net添加log4net日志功能
.Net Core

C#, .Net添加log4net日志功能

9185

log4net.config配置文件?xml version="1.0" encoding="utf-8"?configuration configSections section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net-net-1.0"/ /configSections log4netappende…

WPF页面基础布局源码实例
WPF

WPF页面基础布局源码实例

177

效果图Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" …

WPF 全局Style样式使用
WPF

WPF 全局Style样式使用

98

1、新建一个资源词典ButtonStyle.xamlResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" !--Button 的全局默认样式-- Style TargetType…

C#, COM串口通讯基类
C#类库与方法

C#, COM串口通讯基类

8099

串口常用的使用流程1、初始化串口2、打开串口3、发送数据4、接收数据public class SerialCommon{ public SerialPort MySerialPort = new SerialPort(); public string[] GetPortNames() { return SerialPort.GetPortNames();//获取当前计算机的串行端口名…