在通用Windows平台应用程序中的用户之间共享数据文件 [英] Sharing data files between users in a Universal Windows Platform application

查看:185
本文介绍了在通用Windows平台应用程序中的用户之间共享数据文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将着手使用通用Windows平台(Windows 10)开发一系列业务应用程序。该应用程序的要求之一是将数据从服务器同步到本地SQLite数据库。之所以需要这样做,是因为该应用程序需要在没有网络连接的情况下可用。



很可能有多个(Windows域)用户将在同一用户上访问该应用程序设备,有时只是通过交换用户,有时是通过注销第一个用户并以新用户身份登录。



我意识到UWP应用程序安装在用户级别,但是我希望能够在这些用户之间共享SQLite数据库,而不是强迫每个用户下载自己的数据副本。



?我正努力在



或者,管理员可以在HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager

下创建一个名为AllowSharedLocalAppData的REG_DWORD值,其值为1





请注意,只要在以下位置安装了应用程序,ShareLocal中的数据存储将仅保留设备,不会被系统备份。



I am about to embark on the development of a line of business application using the Universal Windows Platform (Windows 10). One of the requirements of the application is the synchronisation of data from a server to a local SQLite database; this is required because the application needs to be usable where there is no network connectivity.

It is likely that multiple (windows domain) users will be accessing the application on the same device, sometimes simply by "swapping users", other times by logging off the first user and logging on as a new user.

I realise that UWP applications are installed at a user level, however I would like to be able to share the SQLite database between these users instead of forcing each user to download their own copy of the data.

Is this possible? I am struggling to find any reference to this kind of sharing within the Microsoft documentation - but of course that documentation is new and far from complete!

I guess at the end of the day I am looking for access to a folder that is accessible by any user running that application on the same device, such as the "x:\Users\Public" folders that are available from the desktop, but without having to ask the user to provide access to that folder via any picker control - instead simply being able to "open" it.

Thanks.

解决方案

In case anyone runs across this, this functionality is now available as described in this blog post:

We introduced a new storage location Windows 10, ApplicationData.SharedLocalFolder, that allows multiple users of one app to share local data. Obviously this feature is only interesting with devices that will be used by more than one person. For such scenarios, for example in educational uses, it may make sense to place any large downloads in Shared Local. The benefits will be two-fold: any user can access these files without the need to re-download them, also there will be storage space savings

Keep in mind that Shared Local is only available if the machine has the right group policy, otherwise when you call ApplicationData.Current.SharedLocalFolder you will get back a null result.

In order to enable Shared Local the machine administrator should enable the corresponding policy.

Alternatively, the administrator could create a REG_DWORD value called AllowSharedLocalAppData with a value of 1 under HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager

Note that data store in ShareLocal will only be persisted as long as the app is installed on the device and won’t be backed up by the system.

这篇关于在通用Windows平台应用程序中的用户之间共享数据文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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