随笔分类 - 5-.NET Core C#9.0
摘要:前言 我们在编程过程中,经常需要将一个对象转成另一个对象(一般称为对象映射)。 比如我们有2个类: //第1个类 CLS1 class CLS1 { public int i {get; set;} public string str {get; set;} } //第2个类 CLS2 class
阅读全文
摘要:开篇日常立个flag.... 代码 命名空间 System.Security.Cryptography public enum enmKeyBit { KeyBit128 = 128, KeyBit192 = 192, KeyBit256 = 256, } public class EncryptN
阅读全文
摘要:String 和 StringBuilder r:https://www.cnblogs.com/cang12138/p/7323709.html (苍 的 C# String与StringBuilder) 字符串一定创建就不可修改大小,所以当有多个字符串拼接时,其实会有系统开销 使用 String
阅读全文
摘要:多线程概念 两个名词 线程不安全:多个线程访问同一段代码,产生不确定结果(冲突) 线程安全:各个线程正常且正确执行,不会出现数据污染等意外 多线程的例子 例1:两个线程同时打印 static void Main(string[] args) { Method1(); Method2(); Conso
阅读全文