Windows 8 Metro 应用程序文件共享访问 [英] Windows 8 Metro App File Share Access

查看:26
本文介绍了Windows 8 Metro 应用程序文件共享访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Windows 8 Metro 应用程序,我们打算将它部署到我们公司内的几台平板电脑上.它不适用于 Windows 应用商店.

I am developing a Windows 8 Metro app, and we intend to deploy it to only a few tablets within our company. It's not meant for the Windows Store.

我们需要应用访问公司网络共享上的一些目录,但强制用户使用 FilePicker 并不是我们想要的.

We need the app to access some directories on the company's network share, but forcing the user to use a FilePicker isn't what we want.

我们的第一次尝试是使用 await StorageFolder.GetFolderFromPathAsync("J:\");.这不起作用,并产生了以下异常:

Our first attempt was to use await StorageFolder.GetFolderFromPathAsync("J:\");. This didn't work, and produced the following exception:

System.UnauthorizedAccessException"类型的未处理异常发生在mscorlib.dll

An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

WinRT 信息:无法访问指定的文件或文件夹 (J:).该项目不在应用程序可以访问的位置(包括应用程序数据文件夹、可通过以下方式访问的文件夹StorageApplicationPermissions 中的功能和持久化项目列表).验证该文件未标记系统或隐藏文件属性.

WinRT information: Cannot access the specified file or folder (J:). The item is not in a location that the application has access to (including application data folders, folders that are accessible via capabilities, and persisted items in the StorageApplicationPermissions lists). Verify that the file is not marked with system or hidden file attributes.

附加信息:访问被拒绝.(HRESULT 的例外情况:0x80070005 (E_ACCESSDENIED))

Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

所以我们尝试将 "J:" 替换为驱动器映射到的网络路径.这也不起作用,我们得到了这个异常:

So we tried replacing "J:" with the network path the drive was mapped to. This also didn't work, and we got this exception:

在 mscorlib.dll 中发生了System.UnauthorizedAccessException"类型的未处理异常

An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

WinRT 信息:无法访问指定的文件 (\domainpathJDrive).验证是否在清单中为此类文件声明了文件类型关联,并且该文件未标记系统或隐藏文件属性.

WinRT information: Cannot access the specified file (\domainpathJDrive). Verify that there is a file type association declared in the manifest for this type of file and that the file is not marked with the system or hidden file attributes.

附加信息:访问被拒绝.(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED))

Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

我们的应用具有以下功能:

Our app has the following Capabilities:

  • 企业认证
  • 互联网(客户端)
  • 私有网络(客户端和服务器)

我们的应用没有声明

这对于 Windows 应用商店应用来说是非常合理的,但是对于不进入应用商店的简单内部应用是否有任何解决方法?

This is all very reasonable for a Windows Store app, but is there any workaround for a simple in-house app that isn't going to the Store?

推荐答案

我们目前正在通过 WCF Web 服务 访问文件共享来解决这个问题.它远非理想,但它为我们提供了我们需要的东西.

We're currently working around this by accessing the file share through a WCF Web Service. It's far from ideal, but it gets us what we need.

这篇关于Windows 8 Metro 应用程序文件共享访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆