随笔分类 -  .Net实验笔记

摘要:案例是要实现一个对文档文本进行字符处理,并能筛选分离出文档中的单词,且可以以序列索引来对其中的单词进行访问和修改完整代码View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 索引2{ class Program { static void Main(string[] args) { Document mydoc = new Document("Hello,I am a Coder!")... 阅读全文
posted @ 2012-06-08 12:38 MadKeX 阅读(312) 评论(0) 推荐(0)
摘要:事件信息EventArgs:http://msdn.microsoft.com/zh-cn/library/system.eventargs.aspx1事件信息可以用于传递处理附带的事件数值,可以自定义事件信息类型来继承2事件委托可以声明在事件的类型中,并可以通过【类型名.事件委托名】来调用该委托类型创建事件的处理代理using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 事件2{ class Program { static void Ma... 阅读全文
posted @ 2012-06-06 20:24 MadKeX 阅读(3870) 评论(1) 推荐(1)
摘要:c#中事件的声明和触发是通过定义的delegate委托类型来完成的using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 事件1{ class Program { static void Main(string[] args) { myChangedEvent mce = new myChangedEvent(); myEventListener mel = new myEventLi... 阅读全文
posted @ 2012-06-05 16:58 MadKeX 阅读(14021) 评论(0) 推荐(1)
摘要:在继承类中,可以通过override和new来重写隐藏基类声明为virtual的方法using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 版本控制{ class Program { static void Main(string[] args) { myderived md = new myderived(); md.met1(); md.met2(); ... 阅读全文
posted @ 2012-05-28 22:03 MadKeX 阅读(265) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 方法{ class Program { static void Main(string[] args) { Console.WriteLine(mysum(1, 2, 3, 4, 5, 6)); } static long mysum(params long[] v)//这里利用params关键字可以使得调用时的参数的个数可... 阅读全文
posted @ 2012-05-22 23:12 MadKeX 阅读(1765) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace cmdline{ class Program { static void Main(string[] args) { Console.WriteLine("命令行参数个数{0}",args.Length); foreach (string s in args) //利用foreach遍历args命令行参数 {... 阅读全文
posted @ 2012-05-22 22:31 MadKeX 阅读(451) 评论(0) 推荐(0)