NetBlog主题
8561
相关的视频教教程 https://www.bilibili.com/video/BV1sZ4y1F74A?share_source=copy_web 1、我们先建一个类库里面内容如下namespace ClassLibrary3{public class Class1{public string GetTime(){return "现在时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");}}…
4951
public class Student{public string name;public int num;}ListStudent students=new ListStudent();//假设students集合里面添加了数据ListStudent temp1= students.OrderBy(s = s.num).ToList();//num 小大到ListStudent temp2= students.OrderByDescending(…
3155
以下是核心代码public enum WindowsEnmu{Windows95,Windows98_V2,Windows98,WindowsMe,WindowsNT_351,WindowsNT_40,Windows2000,Windows_XP,Windows_2003,WindowsVista,Windows7,Windows10}public WindowsEnmu GetWindowsVersion(){WindowsEnmu WinVersion = WindowsEnmu.…
3894
/// summary/// 比较两个DataTable 表结构是否一样/// /summary/// param name="dt1"/param/// param name="dt2"/param/// param name="order"是否要求两个DdataTable列顺序一样/param/// returns/returnsprivate bool Compare(DataTable dt1, Dat…
5816
Socket服务端可能有一些长期连接的Socket客户端,并且长期不发送数据到服务端,这样很浪费服务端资源。下面代码是服务端主动断开无用的Socket客户端/// summary/// 接收客户端发来的信息/// /summarystatic void ServerRecMsg(object socketClientPara){Socket socke…
4563
public int getHeight4(byte data){//获取高四位int height;height = ((data & 0xf0) 4);return height;}public int getLow4(byte data){//获取低四位int low;low = (data & 0x0f);//0x0f(00001111)return low;//由此可以推出 获取低5位 则data与 00011111(0x1f)相与}…
5245
以下核心代码public partial class Form1 : Form{//更多相关源码请防问 www.luofenming.compublic Form1(){InitializeComponent();}/// summary/// 用于UDP发送的网络服务类/// /summaryprivate UdpClient udpcRecv = null;private IPEndPoint localIpep = null;/// su…
5018
Redis 加锁与解锁类,引用 using StackExchange.Redis;
///
/// redis分布式锁
/// 分布式锁四要素
/// 1、锁名
/// 2、加锁
/// 3、解锁
/// 4、锁超时时间
///
class RedisLock
{//转载请保留 http://www.luofenming.com/show.aspx?id=ART20200701000…
3542
Redis消息队列类 引用using ServiceStack.Redis;
转载请保留:http://www.luofenming.com/show.aspx?id=ART2020062700001
public class RedisMessageQueue : IDisposable
{/// /// redis客户端/// public RedisClient redisClient { get; }public RedisM…
4835
帮助类
public class ExcelHelper
{private string templatePath;private string newFileName;private string templdateName;private string sheetName;public string SheetName{get { return sheetName; }set { sheetName = value; }}public ExcelHelper(string templdateNam…