gpt4 book ai didi

c# - 在 Silverlight App 中拖放文件夹

转载 作者:太空宇宙 更新时间:2023-11-03 14:04:15 24 4
gpt4 key购买 nike

我有一个 silverlight 上传控件。它处理文件的拖放,非常好。用户可以将多个文件拖到控件中,它会上传它们。

但是,我无法让它与文件夹一起使用。我希望能够将文件夹拖放到控件上,然后上传文件夹中的所有文件。

我遇到了很多问题,检测到它是一个文件夹,而不是一个文件。 DragEventArg 的数据似乎是 FileInfo[]。我已经尝试了所有我能想到的方法,检查数组中的每个 FileInfo。我的大部分尝试似乎在 silverlight 中都是不允许的。其余的,没有任何影响。

这是一个内部应用程序,托管在我们的内部网上。

我能以某种方式解析它吗?

最佳答案

Silverlight 不允许直接访问文件系统(除非具有提升的 Intranet 权限和 OOB 模式)。

您访问的文件是通过流而不是直接访问的。默认情况下不允许访问文件夹,但您可以将您的应用设为 Intranet 上的受信任应用。

Trusted Applications

In Silverlight 5, trusted applications have additional capabilities unavailable in previous versions of Silverlight. Specifically, Silverlight 5 trusted applications can do the following:

Access the local file system without restrictions.

Access security critical methods without a MethodAccessException occurring. This is supported for Windows-based applications only.

Run inside the browser if the computer and application are properly configured, as previously mentioned.

Create multiple windows when running outside the browser.

关于c# - 在 Silverlight App 中拖放文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9868246/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com