会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
思维乐趣
博客园
首页
新随笔
联系
管理
订阅
2016年4月19日
获得指定文件夹所有文件的路径
摘要: //获得指定文件夹所有文件的路径 string[]path=Directory.GetFiles(@"C:\Users\Administrator\Desktop\新建文件夹");
阅读全文
posted @ 2016-04-19 20:17 思维乐趣
阅读(326)
评论(0)
推荐(0)
2016年4月16日
遍历Dictionary
摘要: Dictionary<int, string> dic = new Dictionary<int, string>(); dic.Add(1, "睛睛青"); dic[2] = "sb"; foreach (KeyValuePair<int, string> kup in dic) { Consol
阅读全文
posted @ 2016-04-16 13:36 思维乐趣
阅读(370)
评论(0)
推荐(0)
使用多态求矩形的面积和周长以及圆形的面积和周长
摘要: //使用多态求矩形的面积和周长以及圆形的面积我周长 Shape shape = new Circle(5); //new Square(5,6); double area = shape.GetArea(); double perimeter = shape.GetPerimeter(); Cons
阅读全文
posted @ 2016-04-16 01:32 思维乐趣
阅读(1221)
评论(0)
推荐(0)
2016年4月15日
多态练习
摘要: 更改前超复杂: static void Main(string[] args) { //真的鸭子嘎嘎叫 木头鸭子吱吱叫 橡皮鸭子唧唧叫 RealDuck rd = new RealDuck(); rd.Bark(); MuDuck md = new MuDuck(); md.Bark(); XpDu
阅读全文
posted @ 2016-04-15 22:43 思维乐趣
阅读(352)
评论(0)
推荐(0)
StreamReader和StreamWriter 读取 写入一个文本文档
摘要: ////使用StreamReader来读取一个文本文件 //using (StreamReader sr = new StreamReader(@"C:\Users\Administrator\Desktop\sb.txt",Encoding.Default)) //{ // while(!sr.E
阅读全文
posted @ 2016-04-15 19:26 思维乐趣
阅读(285)
评论(0)
推荐(0)
使用文件流来实现多媒体文件的复制
摘要: //思路:就是先将要复制的多媒体文件读取出来,然后再写入到你指定的位置 //C:\Users\Administrator\Desktop\01类.avi string source = @"C:\Users\Administrator\Desktop\01类.avi"; string target
阅读全文
posted @ 2016-04-15 19:02 思维乐趣
阅读(196)
评论(0)
推荐(0)
File
摘要: //指定位置写入文件 //没有这个文件的话 会给你创建一个 有的话会覆盖 string str = "今天下雨"; byte[] buffer = Encoding.Default.GetBytes(str); File.WriteAllBytes(@"C:\Users\Administrator\
阅读全文
posted @ 2016-04-15 10:39 思维乐趣
阅读(202)
评论(0)
推荐(0)
Hashtable
摘要: Hashtable ht = new Hashtable(); ht.Add(1,"张三"); ht.Add(2, 2); ht.Add(3.14,500m); //在键值对集合中键必须是唯一的 //ht.Add(1, 5);//这样会抛异常 ht[1] = "李四";//表示将键1值替换掉 //如
阅读全文
posted @ 2016-04-15 10:08 思维乐趣
阅读(181)
评论(0)
推荐(0)
2016年4月14日
简繁转换
摘要: private const string Jian = "阿"; private const string Fan = "阿"; static void Main(string[] args) { //将用户输入的简体字转换成繁体字 Hashtable ht = new Hashtable(); f
阅读全文
posted @ 2016-04-14 22:44 思维乐趣
阅读(220)
评论(0)
推荐(0)
记录输出时间
摘要: Stopwatch sw = new Stopwatch(); int[] nums = new int[10000]; sw.Start(); for (int i = 0; i < nums.Length; i++) { Console.WriteLine(nums[i]); } sw.Stop
阅读全文
posted @ 2016-04-14 21:52 思维乐趣
阅读(183)
评论(0)
推荐(0)
下一页
公告