惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 【当耐特】
The Cloudflare Blog
B
Blog
Last Week in AI
Last Week in AI
小众软件
小众软件
量子位
S
SegmentFault 最新的问题
V
Visual Studio Blog
博客园 - 叶小钗
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
A
About on SuperTechFans
雷峰网
雷峰网
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Martin Fowler
Martin Fowler

博客园 - Arthur_wuancheng(大步牛)

练手之作:易元威客任务发布系统(2) 练手之作:易元威客任务发布系统(1) 人生一世 草木一秋 如何进行高效的项目管理?(转) 项目管理的一点总结 极限编程法一点思考 WEB Service 下实现大数据量的传输 (转) 项目经验(转) Atlas 学习笔记: ajax 改进 by Atlas ajax for .net in vs2003 like gmail ^_^ 存储过程分页,以及动态sql(Sql server) WebService Enhancements 2.0 Learning Note ref type & out type Duwamish架构分析篇 (转) 程序编码应保持良好的规范(C#)(转) 也谈代码规范 (转) 如何用正确的方法来写出质量好的软件的75条体会 [转] How to Write to Database by EnterPriseLibrary2005 Logging Application Block(项目心得) 自己正在做电信的互联星空项目,里面用到的xml
C# 2.0 New Feature(1)
Arthur_wuancheng(大步牛) · 2005-11-20 · via 博客园 - Arthur_wuancheng(大步牛)

今天下载并安装了visual stdio 2005 for team   for develop  for ..............^_^

赶快装一下,不错

我要传整屏,有限制,只能翻过来传上
再装msdn,
后发现sql server 2005 expess 太弱了,下了一个  正式版 for developer 

1.  new feature
有了一个很贴心 的特性 
自定义可以被 foreach 的类

引用一下msdn的源程序了

 1        //继承System.Collections.IEnumerable
 2        public class dayWeeks : System.Collections.IEnumerable
 3        {
 4            //定义一个string[]
 5            string[] dayWeek = "Sun""Mon""Tue""Wed""Thr""Fri""Sat" };
 6            //重载GetEnumerator()
 7            public System.Collections.IEnumerator GetEnumerator()
 8            {
 9                for (int i = 0; i < dayWeek.Length; i++)
10                {
11                    //yield return   呵呵,^_^,专用于  iterator block  
12                    yield return dayWeek[i];
13                }

14            }

15        }

16        static void Main(string[] args)
17        {
18            new Program().printer("this is my vs 2005");
19
20
21            // Declare a list of type int
22            GenericList<int> list1 = new GenericList<int>();
23
24            // Declare a list of type string
25            GenericList<string> list2 = new GenericList<string>();
26
27            // Declare a list of type ExampleClass
28            GenericList<ExampleClass> list3 = new GenericList<ExampleClass>();
29            
30
31            //好了定义一个对象
32            dayWeeks dayWeeks = new dayWeeks();
33            //go ahead   foreach.
34            foreach (string j in dayWeeks)
35            {
36                System.Console.WriteLine(j);
37            }

38
39           
40        }

posted on 2005-11-20 01:01  Arthur_wuancheng(大步牛)  阅读(1285)  评论()    收藏  举报