如何使用C#存储和检索ArrayList中的值 [英] How to store and retrive the values in ArrayList using C#

查看:85
本文介绍了如何使用C#存储和检索ArrayList中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,



如何使用C#存储和检索ArrayList中的值?



谢谢提前。

Hai,

How to store and retrive the values in ArrayList using C#?

Thanks in advance.

推荐答案

ArrayList a = new ArrayList();

//在ArrayList中存储valus

a.Add(a);

a.Add(b);

a.Add(c);

a.Add(d);

a.Add(e);



//检索recoprds来自ArrayList

foreach(字符串s in a)

{

Console.WriteLine(s);

}
ArrayList a = new ArrayList();
//Storing the valus in the ArrayList
a.Add("a");
a.Add("b");
a.Add("c");
a.Add("d");
a.Add("e");

//Retrieving the recoprds from the ArrayList
foreach (string s in a)
{
Console.WriteLine(s);
}


Google?



这两个链接应该足以让你入门:

< a href =http://msdn.microsoft.com/en-us/library/system.collections.arraylist%28v=vs.71%29.aspx> http://msdn.microsoft.com/en-us /library/system.collections.arraylist%28v=vs.71%29.aspx [ ^ ]

http://www.dotnetperls.com/arraylist [ ^ ]
Google?

These two links should be enough to get you started:
http://msdn.microsoft.com/en-us/library/system.collections.arraylist%28v=vs.71%29.aspx[^]
http://www.dotnetperls.com/arraylist[^]


试试这个

C#中的ArrayList


这篇关于如何使用C#存储和检索ArrayList中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆