为WinForm的RichTextBox控件设置指定行的文字颜色
/// summary/// 给RichTextBox指定行设置文字颜色/// /summary/// param name="rtb"目标RichTextBox控件/param/// param name="lineIndex"行号(从0开始计数)/param/// param name="color"要设置的颜色/parampublic void SetRichTextBoxLineColor(Rich…
/// summary/// 给RichTextBox指定行设置文字颜色/// /summary/// param name="rtb"目标RichTextBox控件/param/// param name="lineIndex"行号(从0开始计数)/param/// param name="color"要设置的颜色/parampublic void SetRichTextBoxLineColor(Rich…
public class IdWorker{ //机器ID private static long workerId; private static long twepoch = 0L; //唯一时间,这是一个避免重复的随机量,自行设定不要大于当前时间戳 private static long sequence = 0L; private static int workerIdBits = 4; //…
using ServerManagement.Models;using System.Net;using System.Net.Sockets;using System.Text.RegularExpressions;namespace ServerManagement.Common{ public class WakeOnLan { /// summary /// 发送唤醒数据包 /// /summary …
using System.Diagnostics;using System.Runtime.InteropServices;namespace ComputerPower.Common{ public class SystemShutdown { /// summary /// 关机或重启计算机 /// /summary /// param name="action"操作类型:shutd…
在这里我用的是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 是要注册的…
log4net.config配置文件?xml version="1.0" encoding="utf-8"?configuration configSections section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net-net-1.0"/ /configSections log4netappende…
效果图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" …
1、新建一个资源词典ButtonStyle.xamlResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" !--Button 的全局默认样式-- Style TargetType…
串口常用的使用流程1、初始化串口2、打开串口3、发送数据4、接收数据public class SerialCommon{ public SerialPort MySerialPort = new SerialPort(); public string[] GetPortNames() { return SerialPort.GetPortNames();//获取当前计算机的串行端口名…
public bool AreByteArraysEqual(byte[] a, byte[] b){ if (a == null || b == null || a.Length != b.Length) { return false; } for (int i = 0; i a.Length; i++) { if (a[i] != b[i]) { return false; …