Loading...
单件模式是开发中非常常用的模式,每次形式又是固定的,所以想是否可以用泛型?一搜发现这个需求还是挺常见的,这里记录一下。原出处已经忘了,所以未标注 /// <summary> /// 单件模式的管理类的泛型模版 /// </summar...
看到一篇C#下使用SQLite数据库的文章,写的浅显易懂。非常不错。转存。 转载地址 https://www.cnblogs.com/leemano/p/...
使用下方复制函数的类,都需要在类前添加 [Serializable],让类支持序列化。1:利用反射实现public static T DeepCopy<T>(T obj) { //如果是字符串或值类型则直接返回 if (obj is st...
开发中用到需要将秒数(精度可能超过1s)转换成日、时、分、秒的格式,显示到界面上。找了一圈用TimeSpan的都是自己手动拼的字符串,不太漂亮。实际Tim...
CANoe中使用的时间单位是s, 记录的时间保留到小数点后6位,也就是微秒μs. 这个还挺NB的但是从CAN卡中获取到的报文的时间是unix时间戳的格式。这种时间戳是从1970年1月1号0时0分0秒开始计算,以秒为单位的一个长整形数字。这就需要在DateTime和时间戳之间...