摘要: Int32 i = 10; Object obj = new Object(); try { obj = i; Console.Write("装箱成功\n"); // Console.Write() } catch(Exception ex) { Console.Write("装箱失败"); Console.Write(ex.ToString()); return; } try { Int64 j = (Int64)obj;//这里会出现错误 Console.Write("拆箱成功"); } catch(Exception ex) { 阅读全文
posted @ 2013-03-09 21:00 才高远志 阅读(112) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { List<string> tmplist = new List<string>(); tmplist.Add("A"); tmplist.Add("B"); tmplist.Add("C"); for (int i = 0; i < tmplist.Count; i++) { tmplist.RemoveAt(i); } if (tmplist.Count > 0) { Console.Write("\n剩余的元素的个数有 阅读全文
posted @ 2013-03-09 20:58 才高远志 阅读(136) 评论(0) 推荐(0) 编辑