如何将文件夹添加到.net 中的列表框?
我有一个列表框,我想在指定位置添加一个文件夹/目录,我已经使用了代码,
string path = "E:\\shruti\\MyDir";
DirectoryItem folder = new DirectoryItem(path);
lstBurnItems.Items.Add(folder); //add folder to listbox
但它无法正常工作... 我应该做什么才能成功?
i have a list box and i want to add a folder/directory to that which is at the specified location i have used the code
string path = "E:\\shruti\\MyDir";
DirectoryItem folder = new DirectoryItem(path);
lstBurnItems.Items.Add(folder); //add folder to listbox
but its not working fine...
what should i do to get success??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的示例展示了如何将文件夹中的文件夹添加到
ListBox
以及如何将文件夹中的文件添加到ListBox
中。抱歉,你没说清楚,所以我都给了。Below is an example showing how to add folders within a folder to a
ListBox
and to add Files within a folder into aListBox
. Sorry, you weren't clear so I gave both.