System.IO.Directory.Getfiles Silverlight 4 不工作
我正在使用 Silverlight 4 OOB &提高信任度。
我需要获取特定目录上的所有文件名&填充对象 List(Of String)
编译器在 .Getfiles() 方法上抛出错误“找不到方法”。
Dim files() As String = System.IO.Directory.Getfiles(Path) 'this line is failing..
帮助!
I'm using Silverlight 4 OOB & elevated trust.
I need to get all the filenames on specific directory & populate an object List(Of String)
The compiler throws an error "Method not found" on .Getfiles() method.
Dim files() As String = System.IO.Directory.Getfiles(Path) 'this line is failing..
Help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GetFiles
被标记为“安全关键”,因此无法在您的代码中使用。您将需要使用
EnumerateFiles
方法。GetFiles
是 sooo .NET 1.0,EnumerateFiles
更加灵活,即使在完整的框架中,如果可以的话,您也希望避免使用这个旧的 Array 返回 API。The
GetFiles
is marked as "Security Critical" and therefore cannot be used from your code.You will want to use the
EnumerateFiles
method instead.GetFiles
is sooo .NET 1.0,EnumerateFiles
is much slicker, even in the full framework you'd want avoid this older Array returning API if you can.据我所知,您无法使用 Silverlight OOB 直接访问整个硬盘驱动器。
引用自 Silverlight 网站:
有关如何使用 Silverlight OOB 处理硬盘的详细信息,请参阅此链接:
http://www.silverlight.net/learn/overview/out-of-browser-applications/advanced-silverlight-out-of-browser-introduction#Exercise3
As far as I know you cannot directly access the whole hard drive using Silverlight OOB.
Quoting from Silverlight site:
Please refer to this link for details on how to work with the hard drive using Silverlight OOB:
http://www.silverlight.net/learn/overview/out-of-browser-applications/advanced-silverlight-out-of-browser-introduction#Exercise3