日期:2014-05-17 浏览次数:20913 次
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string[,] table = new string[,] {{"001","caojw","90"},
{"002","caij","89"},
{"003","shaohx","92"}};
for (int i = 0; i < table.GetLength(1); i++)
{
foreach (string score in ArrayItems(table, i,2))
{
Response.Write(score + "</br>");
}
}
}
}
/// <summary>
/// 实现一个迭代器
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="data"></param>
/// <param name="colindex"></param>
/// <param name="rowindex"></param>
/// <returns></returns>
IEnumerable<T> ArrayItems