Silverlight-遍历本地文件夹
来源:互联网 发布:学java好还是php好 编辑:程序博客网 时间:2024/05/16 14:45
SilverLight遍历本地用户文件夹,由于安全性考虑,SilverLight只能遍历我的文档,我的视频,我的图片,我的音乐四个本地文件夹,而且只能运行于Out-Of-Broswer模式中
帖代码:
Dim folderList As New List(Of String)
'Directory.EnumerateFiles 用于在被受信任的应用程序调用时,返回指定路径中文件名的可枚举集合
'Environment.GetFolderPath:用来返回文件的完整路径
'Environment.SpecialFolder:包含我们需要获取的文件类型
Dim docs = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments))'我的文档
Dim videos = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyVideos))'我的视频
Dim photos = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures))'我的图片
Dim music = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyMusic)) '我的音乐
For Each item AsString In docs
folderList.Add(item)
Next
Me.lstFiles.ItemsSource = folderList
'Directory.EnumerateFiles 用于在被受信任的应用程序调用时,返回指定路径中文件名的可枚举集合
'Environment.GetFolderPath:用来返回文件的完整路径
'Environment.SpecialFolder:包含我们需要获取的文件类型
Dim docs = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments))'我的文档
Dim videos = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyVideos))'我的视频
Dim photos = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures))'我的图片
Dim music = Directory.EnumerateFiles(Environment.GetFolderPath(System.Environment.SpecialFolder.MyMusic)) '我的音乐
For Each item AsString In docs
folderList.Add(item)
Next
Me.lstFiles.ItemsSource = folderList
本文来自softkexin的博客,原文地址:http://blog.csdn.net/softkexin/article/details/6743587
- SilverLight-遍历本地文件夹
- Silverlight-遍历本地文件夹
- 非递归方式遍历本地文件夹
- C#.Net遍历本地文件夹下的所有文件
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 文件夹遍历
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 文件夹遍历
- 报表制作工具中Cnmoney()函数使用
- 触发器认识
- getRealPath
- 延长Visual Assist和FinalBuilder 5的试用时间
- 完美解决IE6不支持position:fixed的bug
- Silverlight-遍历本地文件夹
- 大量数据的页面结构
- 关于java的JIT知识
- sql server 关于不等于运算符的研究 '<>'
- 什么是STK卡
- 触发器
- AT指令集相关内容
- 华为机试
- imsdroid 在google code上的下载地址