2016年8月21日

c# List<int> 转 string 以及 string [] 转 List<int>

摘要: List<int> 转 string : list<int>: 1,2,3,4,5,6,7 转换成字符串:“1,2,3,4,5,6,7” string 转 List<int>: List<string> 转 List<int> List<int> 转List<string> C#中string[]数 阅读全文

posted @ 2016-08-21 11:15 大西瓜3721 阅读(1844) 评论(0) 推荐(0)

C#中的lock关键字

摘要: 前几天与同事激烈讨论了一下,有一点收获,记录起来。 首先给出MSDN的定义: lock 关键字可以用来确保代码块完成运行,而不会被其他线程中断。这是通过在代码块运行期间为给定对象获取互斥锁来实现的。 先来看看执行过程,代码示例如下: 假设线程A先执行,线程B稍微慢一点。线程A执行到lock语句,判断 阅读全文

posted @ 2016-08-21 09:57 大西瓜3721 阅读(281) 评论(0) 推荐(0)

导航