WPF中怎么遍历文件夹中的所有图片然后显示出来

郑杰 2012-05-24 04:03:35
WPF中怎么遍历文件夹中的所有图片然后显示出来
...全文
1013 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
nonocast 2012-05-24
  • 打赏
  • 举报
回复
程序猿CKeen 2012-05-24
  • 打赏
  • 举报
回复
好像是Bitmap的ImageSource属性设置。
avi9111 2012-05-24
  • 打赏
  • 举报
回复
和c# 相同

BitmapImage
zhoucong1020 2012-05-24
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

引用 3 楼 的回复:

引用 2 楼 的回复:
引用 1 楼 的回复:

C# code

public static void DeleteFolder(string dir)
{
if (System.IO.Directory.Exists(dir)) //如果存在这个文件夹删除之
{
foreach (string d in System.IO.Dire……
……
[/Quote]
你是要显示在什么里面,Wpf的Listview?
郑杰 2012-05-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

引用 2 楼 的回复:
引用 1 楼 的回复:

C# code

public static void DeleteFolder(string dir)
{
if (System.IO.Directory.Exists(dir)) //如果存在这个文件夹删除之
{
foreach (string d in System.IO.Dire……


哥哥,我不是


要删除。。。……
[/Quote]
问题是我就不会读取。。。
surlew 2012-05-24
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
引用 1 楼 的回复:

C# code

public static void DeleteFolder(string dir)
{
if (System.IO.Directory.Exists(dir)) //如果存在这个文件夹删除之
{
foreach (string d in System.IO.Dire……


哥哥,我不是要删除。。。我是要读取出来然后显示啊。。
[/Quote]

呵呵,你把他删除的内容换成你读取就可以啦
郑杰 2012-05-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

C# code

public static void DeleteFolder(string dir)
{
if (System.IO.Directory.Exists(dir)) //如果存在这个文件夹删除之
{
foreach (string d in System.IO.Dire……
[/Quote]

哥哥,我不是要删除。。。我是要读取出来然后显示啊。。
lw_881020 2012-05-24
  • 打赏
  • 举报
回复

public static void DeleteFolder(string dir)
{
if (System.IO.Directory.Exists(dir)) //如果存在这个文件夹删除之
{
foreach (string d in System.IO.Directory.GetFileSystemEntries(dir))
{
if (System.IO.File.Exists(d))
System.IO.File.Delete(d); //直接删除其中的文件
else
DeleteFolder(d); //递归删除子文件夹
}
System.IO.Directory.Delete(dir); //删除已空文件夹
}
}

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧