摘要:
情况是这样的, 慢慢听我道来~新建了一个MVC 3的项目, 在HomeController中继承BaseControllerCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.Mvc; 6 using System.Web. 阅读全文
摘要:
循环语句是编程的基本语句,在C#中除了沿用C语言的循环语句外,还提供了foreach语句来实现循环。那么我要说的就是,在循环操作中尽量使用foreach语句来实现。为了来更好地说明为什么要提倡使用foreach,用如下三种不同方式来编写循环语句。int[] nArray = new int[100];// Use "foreach" to loop arrayforeach( int i in nArray ) Debug.WriteLine( i.ToString() );// Use "for" to loop arrayfor( int i = 0 阅读全文