• Silverlight遍历本地文件夹


    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 As String In docs
    folderList.Add(item)
    Next
    Me.lstFiles.ItemsSource = folderList

      本文来自softkexin的博客,原文地址:http://blog.csdn.net/softkexin/article/details/6743587

    作者:观海看云个人开发历程知识库 - 博客园
    出处:http://www.cnblogs.com/zhangtao/
    文章版权归本人所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Splunk数据处理
    使用http://start.spring.io/ 生成工程
    SpringBoot和SpringCloud区别
    Spring Cloud
    Spring Boot
    Splunk大数据分析经验分享
    Splunk和ELK深度对比
    Git 教程
    Docker 教程
    STL中的unique和unique_copy函数
  • 原文地址:https://www.cnblogs.com/zhangtao/p/2347515.html
Copyright © 2020-2023  润新知