请问,如何得到ArrayList中的某一个元素的值? XXX[0]可能还需要强制类型转换一下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ^_^ ing,既然解决了就好。 xxx[int i]or xxx["memberName"] 或者using System;using System.Collections;namespace ConsoleApplication1{ /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { // // TODO: 在此处添加代码以启动应用程序 // ArrayList arraylist = new ArrayList(); arraylist.Add("Hello"); arraylist.Add("World"); arraylist.Add("!"); System.Collections.IEnumerator Enumerator = arraylist.GetEnumerator(); while (Enumerator.MoveNext()) { Console.Write( "{0}\n", Enumerator.Current ); } } }} 再或者using System;using System.Collections;namespace ConsoleApplication1{ /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { // // TODO: 在此处添加代码以启动应用程序 // ArrayList arraylist = new ArrayList(); arraylist.Add("Hello"); arraylist.Add("World"); arraylist.Add("!"); for (int i=0;i<arraylist.Count;++i) { Console.Write( "{0}\n", arraylist[i] ); } } }} 这是foreach的using System;using System.Collections;namespace ConsoleApplication1{ /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { // // TODO: 在此处添加代码以启动应用程序 // ArrayList arraylist = new ArrayList(); arraylist.Add("Hello"); arraylist.Add("World"); arraylist.Add("!"); foreach (string s in arraylist) { Console.Write( "{0}\n", s ); } } }} ArrayList类实验代码问题。。。。。。。。。。。 如何根据key值获取该key在Dictionary列表中所处的位置 WebClient 上传文件显示进度问题 简单的问题,大家来看看 请教如何降低截取的屏幕图象的质量并通过网络发送 怎样知道最大连接池的数目 请大家介绍个,NET 压力测试的工具吧? 我想通过DataGrid(web下)中的超连接弹出一个新窗口,代码该在哪里写呀..谢谢。 请大家帮忙,怎么对比两个文件之间的差异 關於打包發佈 問題 关于COM+组件的问题,请大家帮帮忙,非常感谢! 如何从查询结果中再进行查询?
or xxx["memberName"]
using System;
using System.Collections;namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
ArrayList arraylist = new ArrayList();
arraylist.Add("Hello");
arraylist.Add("World");
arraylist.Add("!");
System.Collections.IEnumerator Enumerator = arraylist.GetEnumerator();
while (Enumerator.MoveNext())
{
Console.Write( "{0}\n", Enumerator.Current );
}
}
}
}
using System;
using System.Collections;namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
ArrayList arraylist = new ArrayList();
arraylist.Add("Hello");
arraylist.Add("World");
arraylist.Add("!");
for (int i=0;i<arraylist.Count;++i)
{
Console.Write( "{0}\n", arraylist[i] );
}
}
}
}
using System;
using System.Collections;namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
ArrayList arraylist = new ArrayList();
arraylist.Add("Hello");
arraylist.Add("World");
arraylist.Add("!");
foreach (string s in arraylist)
{
Console.Write( "{0}\n", s );
}
}
}
}