数组问题!!! 俺少用,不会!
for(int index=0;index<this.ListBox1.Items.Count;index++)
{
if(this.ListBox1.Items[index].Selected==true)
{
数组=this.ListBox1.Items[index].Text.ToString(); 如何讲它一个一个地放入数组???
}
}
/////
protect void ddd()
{
这里又如何一个一个的重数组中取???
myCommand.parameters["@Text"].Value=从数组取!
}
问题点数:18、回复次数:3Top
1 楼Eddie005(♂) №.零零伍 (♂)回复于 2004-09-01 18:02:27 得分 10
System.Collections.ArrayList tmp = new ArrayList();
for(int index=0;index<this.ListBox1.Items.Count;index++)
{
if(this.ListBox1.Items[index].Selected==true)
{
tmp.Add(this.ListBox1.Items[index].Text.ToString()); 如何讲它一个一个地放入数组???
}
}
/////
protect void ddd()
{
string str="";
for(int i=0;i<tmp.Count;i++)
str+=tmp[i].ToString();
myCommand.parameters["@Text"].Value=str;
}
Top
2 楼triffang(冲凉不除3)回复于 2004-09-01 19:27:11 得分 0
如果要取INT型的数组呢?
还能用System.Collections.ArrayList吗?
例如我想取
数组=Convert.ToInt32(this.ListBox1.Items[index].Value);
Top
3 楼huangsuipeng(hsp|I love foxpig)回复于 2004-09-01 19:30:12 得分 8
无问题
ArrayList是弱类型的Top




