委托和事件的区别详解
摘要:委托的本质,是一个类,而事件,是一个委托类型的私有变量加上两个公有方法(事件的+=和-=),这是本质区别。打个比方,string 也是一个类,而string s = "a",这个s是string类型的一个变量(略有不恰当,为了方便直观理解)。public delegate void myDel();
阅读全文
posted @
2020-08-20 10:24
Manuel
阅读(1396)
推荐(0)
自定义事件的两种方式
摘要:完整版: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threadi
阅读全文
posted @
2020-08-18 20:32
Manuel
阅读(299)
推荐(0)
事件详解
摘要:1.初步了解: (1)事件:指的是能够发生的什么事情。比如公司上市,这里的上市就是事件(比事情更正式。)。 (2)在c#中的定义:是类型的成员。是一种使对象或类具备了通知能力的成员。 (3)事件参数:经由事件发送过来的,与事件本身相关的消息,称为事件参数。 作用:比如,当手机的关注者收到通知之后,就
阅读全文
posted @
2020-08-18 19:32
Manuel
阅读(322)
推荐(0)
事件示例
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Timers; using System.
阅读全文
posted @
2020-08-18 19:24
Manuel
阅读(132)
推荐(0)
以字典形式写入xml
摘要:递归读取字典形式的对象,写入xml文件 using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threa
阅读全文
posted @
2020-08-17 19:05
Manuel
阅读(328)
推荐(0)
以字典形式生成xml
摘要:层级字典构造: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; na
阅读全文
posted @
2020-08-12 10:26
Manuel
阅读(178)
推荐(0)
自动生成xml
摘要:#region 自动生成xml文件 public void GenerateXML(string path, string filename, Mat mat, PredictResult result) { XmlDocument xmlDoc = new XmlDocument(); //创建类
阅读全文
posted @
2020-08-11 09:46
Manuel
阅读(708)
推荐(0)
StringBuilder
摘要:c#中stringbuilder的使用 String 对象是不可改变的。每次使用 System.String 类中的方法之一时,都要在内存中创建一个新的字符串对象,这就需要为该新对象分配新的空间。在需要对字符串执行重复修改的情况下,与创建新的 String 对象相关的系统开销可能会非常昂贵。如果要修
阅读全文
posted @
2020-08-10 13:42
Manuel
阅读(206)
推荐(0)
Interlocked类,原子操作
摘要:https://www.cnblogs C#多线程系列(3):原子操作 本章主要讲述多线程竞争下的原子操作。 目录 知识点 竞争条件 线程同步 CPU时间片和上下文切换 阻塞 内核模式和用户模式 Interlocked 类 1,出现问题 2,Interlocked.Increment() 3,Int
阅读全文
posted @
2020-08-08 10:23
Manuel
阅读(7383)
推荐(5)
存储过程和函数区别
摘要:一、含义不同 1、存储过程:存储过程是 SQL 语句和可选控制流语句的预编译集合,以一个名称存储并作为一个单元处理。 2、函数:是由一个或多个 SQL 语句组成的子程序,可用于封装代码以便重新使用。 函数限制比较多,如不能用临时表,只能用表变量等 二、使用条件不同 1、存储过程:可以在单个存储过程中
阅读全文
posted @
2020-08-07 09:18
Manuel
阅读(1158)
推荐(0)
数据库基础
摘要:https://www.cnblogs.com/yuanchenqi/articles/6357507.html 数据库基础 知识预览 数据库的简介 mysql 回到顶部 数据库的简介 数据库 数据库(database,DB)是指长期存储在计算机内的,有组织,可共享的数据的集合。数据库中的数据按一定
阅读全文
posted @
2020-08-05 20:32
Manuel
阅读(113)
推荐(0)
哈希索引和Btree索引
摘要:https://blog.csdn.net/u014307117/article/details/47325091?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_p
阅读全文
posted @
2020-08-05 16:59
Manuel
阅读(135)
推荐(0)
哈希表hashtable
摘要:https://www.runoob.com/csharp/csharp-hashtable.html https://www.cnblogs.com/-qing-/p/10872940.html
阅读全文
posted @
2020-08-05 10:26
Manuel
阅读(118)
推荐(0)
抽象类和接口
摘要:https://blog.csdn.net/chengmuzhe2690/article/details/80764327 https://blog.csdn.net/wangshubo1989/article/details/48153319?utm_medium=distribute.pc_re
阅读全文
posted @
2020-08-05 10:20
Manuel
阅读(85)
推荐(0)
数组、ArrayList和List<T>的区别
摘要:https://www.cnblogs.com/chris-zeng/p/10540291.html 数组: 优点:数组在内存中是连续存储的、所以它的索引速度是非常快的、时间复杂度为O(1)、而且它的赋值/修改/获取元素也是非常简单的。 缺点:1、定义数组的时候需要指定数组的长度(过长会造成内存浪费
阅读全文
posted @
2020-08-05 09:06
Manuel
阅读(292)
推荐(0)
async/await
摘要:1,,用同步编码的形式编写异步程序 namespace AwaitAsyncLibrary { /// <summary> /// await/async:是个新语法,是个语法糖, /// 不是一个全新的异步多线程使用方式 /// (语法糖:就是编译器提供的新功能) /// 本身并不会产生新的线程,
阅读全文
posted @
2020-08-03 19:37
Manuel
阅读(132)
推荐(0)
线程安全
摘要:线程安全问题: lock的变量是引用类型,与线程操作无关,仅仅起一个标志位的作用,标志该内存是否正在被操作(不允许其他线程进行操作) 若两个线程锁同一个引用变量则不能并发,否之则能并发。 微软官方推荐 private static readonly object LOCK = new object(
阅读全文
posted @
2020-08-03 16:54
Manuel
阅读(103)
推荐(0)
异步多线程2
摘要:同步单线程与异步多线程: 2..NetFramework的几种线程的迭代 3.Task方式的多线程应用 private void btnTask_Click(object sender, EventArgs e) { Console.WriteLine("多个Task异步线程启动 start {0}
阅读全文
posted @
2020-08-03 15:48
Manuel
阅读(172)
推荐(0)
异步多线程
摘要:控制异步多线程顺序的一些方式 1.异步回调,当线程结束时触发回调函数,用于线程结束时的操作(日志打印等) Console.WriteLine(); Console.WriteLine("*********btnAsyncAdvance_Click 异步方法 start {0}********",Th
阅读全文
posted @
2020-08-03 14:10
Manuel
阅读(303)
推荐(0)