随笔分类 - C#
摘要:https://www.microsoft.com/zh-cn/p/nuget-package-explorer/9wzdncrdmdm3?activetab=pivot:overviewtab 来源:https://download.csdn.net/blog/column/9442657/130
阅读全文
摘要:一、首先创建一个控制台应用程序,添加一个Person对象 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; names
阅读全文
摘要:ManualResetEvent 用于表示线程同步事件,可以使得线程等待信号发射之后才继续执行下一步,否则一直处于等待状态中。 ManualResetEvent 的常用方法 构造函数 ManualResetEvent(bool); ManualResetEvent manualResetEvent
阅读全文
摘要:简介 表达式树以树形数据结构表示代码,其中每一个节点都是一种表达式,比如方法调用和 x < y 这样的二元运算等。 你可以对表达式树中的代码进行编辑和运算。这样能够动态修改可执行代码、在不同数据库中执行 LINQ 查询以及创建动态查询。 表达式树还能用于动态语言运行时 (DLR) 以提供动态语言和
阅读全文
摘要:一、lambda表达式介绍无参数 () =>{return "1";}; 等同于 string getnum(){ return "1"; } 有两个参数 (p1, p2) =>{ return p1*p2;}; 等同于 int mul(p1, p2) { return p1*p2;}; lambd
阅读全文
摘要:public static DateTime ConvertTimestampToDateTime(long timestamp) { DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); DateT
阅读全文
摘要:针对ArrayList赋值到另一个ArrayList的方法ArrayList<String> A= new ArrayList<String>(); A.add("1"); A.add("2"); ArrayList<String> B = new ArrayList<String>();; B =
阅读全文
摘要:/// <summary> /// 过长的数据在日志中不显示 /// </summary> /// <param name="orilog">原请求</param> /// <param name="ignore">需要过滤的参数</param> private string RemoveIgnor
阅读全文
摘要:一、struct byte[]互相转换 //struct转换为byte[] public static byte[] StructToBytes(object structObj) { int size = Marshal.SizeOf(structObj); IntPtr buffer = Mar
阅读全文
摘要:/// <summary> /// 将一个字节数组转换为8bit灰度位图 /// </summary> /// <param name="rawValues">显示字节数组</param> /// <param name="width">图像宽度</param> /// <param name="h
阅读全文
摘要:class Program { #region 委托作用 解耦,减少重复代码、异步多线程 #endregion #region Delegate委托 有返回值,无返回值都行 ,有参数无参数都行 //public delegate void myDelegate(); //static void Ma
阅读全文

浙公网安备 33010602011771号