摘要: public class Formater { public static byte[] Serialize(Object _object) { BinaryFormatter binaryFormatter = new BinaryFormatter(); MemoryStream ms = new MemoryStream(); binaryFormatter.Serialize(ms, _... 阅读全文
posted @ 2009-08-12 10:40 漠北水獭 阅读(177) 评论(0) 推荐(0)
摘要: 最近一朋友问道 ,怎样把一组数字如:047 058 074 085 137 157 173 175 317 347 358 371 374 385 407 437 470 473 508 517 538 571 580 583 704 713 715 731 734 740 743 751 805 835 850 853 筛选出其中的不重复的数字如:047 058 137 157 358抱歉没有把... 阅读全文
posted @ 2009-07-24 16:58 漠北水獭 阅读(2606) 评论(17) 推荐(2)
摘要: 1-1000放在含有1001个元素的数组中,只有唯一的一个元素值重复,其它均只出现 一次。每个数组元素只能访问一次,设计一个算法,将它找出来;不用辅助存储空 间,能否设计一个算法实现?class Program { static void Main(string[] args) { int[] list = new int[101]; Random r = new Random(); int a=... 阅读全文
posted @ 2009-07-22 12:50 漠北水獭 阅读(429) 评论(0) 推荐(0)
摘要: 重温经典Singleton模式要求一个类有且仅有一个实例,并且提供了一个全局的访问点。保证一个类仅有一个实例,并提供一个访问它的全局访问点!简单实现1publicsealedclassSingleton2{3staticSingletoninstance=null;45Singleton()6{7}89publicstaticSingletonInstance10{11get12{13if(ins... 阅读全文
posted @ 2009-06-17 11:05 漠北水獭 阅读(250) 评论(4) 推荐(0)
摘要: 1、只复制一个表的结构select * into [tableName1] from [tableName2] -- 表的复制select top 0 * into [tableName1] from [tableName2] -- top 0 的妙用select * into b from a where 1<>1 --where 1<>1 select top 2 * ... 阅读全文
posted @ 2009-06-16 17:48 漠北水獭 阅读(318) 评论(0) 推荐(0)
摘要: 入住博客园了! 阅读全文
posted @ 2009-06-04 13:26 漠北水獭 阅读(125) 评论(1) 推荐(0)