摘要:
1、必须是实现了IEnumerable接口对象才可以调用该方法,通过ToLookup方法,返回的是ILookup<T1,KeyValuePair<T2,T3>> 对象, 筛选KeyValuePair<T2,T3>集合里符合条件的新的数据,并且生成新的集合以类型T1为key,KeyValuePair< 阅读全文
随笔分类 - c#
Task.Factory.StartNew和Queue应用
2022-01-17 00:34 by hello,逗比, 74 阅读, 收藏, 编辑
摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
Queue<T>类
2022-01-16 22:50 by hello,逗比, 32 阅读, 收藏, 编辑
摘要:
class Program { static void Main(string[] args) { Queue<Person> que = new Queue<Person>(); que.Enqueue(new Person("11", 1)); //新增 que.Enqueue(new Pers 阅读全文
c#接口显式和隐式实现的区别
2021-07-08 00:26 by hello,逗比, 187 阅读, 收藏, 编辑
摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 接口显式隐式实现 { class Program 阅读全文
SqlDataReader对象是否含有指定列的判断和衍生
2020-06-26 01:26 by hello,逗比, 365 阅读, 收藏, 编辑
摘要:
1、首先我们判断是否有列,一般是使用数据表来处理 : DataTable dt = null ; dt.Columns.Contains("columnName"); 2、利用异常处理:IndexOutOfRangeException public static string getSQLDataR 阅读全文
c#里面的索引器注意
2017-06-25 11:21 by hello,逗比, 247 阅读, 收藏, 编辑
摘要:
1、特此说明,下面代码是从完整部分复制了部分,未必能直接拷贝执行。 2、索引器里注意 1)如果没有设置数组保存,不能连续访问per2[0],per[1],因为里面的比如 Name是被替换的。 2)我们创建数组保存,需要 创建空间,我们可以 3、索引器里另外灵活运用例子,将索引号不同,给对象不同字段赋 阅读全文
MD5方法代码(生成小写的md5) C#版本
2017-01-09 22:49 by hello,逗比, 2660 阅读, 收藏, 编辑
摘要:
public string GetMD5Str(string input) { // Use input string to calculate MD5 hash MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] inputByt 阅读全文