求大神
c#吧
全部回复
仅看楼主
level 1
he1658005285 楼主
string[] ju = null;
DirectoryInfo di = new DirectoryInfo("F:\\");
FileInfo[] file = di.GetFiles();
int b = 0;
foreach (FileInfo f in file)
{
if (f.Extension ==".jpg")
{
ju[b] = f.Name;
b++;
}
}
foreach (string fd in ju)
{
listBox1.Items.Add(fd);
}
为什么listbox.items什么都没有
2014年03月29日 05点03分 1
level 12
数组不初始化长度怎么用?这个地方用数组都多余,直接在判断为jpg里面添加数据就行了
2014年03月29日 05点03分 2
level 8
foreach中直接items.add不就的了。
2014年03月29日 06点03分 3
1