[UWP] [桌面转换器]发布者为百年转换应用程序共享文件夹,以使两个应用程序可以访问同一个Publisher共享文件夹 [英] [UWP][Desktop Converter]Publisher shared Folder for a Centennial Converted App to enable two apps to access the same Publisher shared folder

查看:99
本文介绍了[UWP] [桌面转换器]发布者为百年转换应用程序共享文件夹,以使两个应用程序可以访问同一个Publisher共享文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个UWP应用程序,它将.txt文件写入共享的Publisher 文件夹,以便其他应用程序可以访问该.txt文件。

I have created a UWP application that will write a .txt file to a shared Publisher folder, so that another application can access that .txt file.

AppxManifest文件包含以下代码:

The AppxManifest file contains the following piece of code :

< 套餐 >

    < 扩展程序 >

  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < 扩展程序
类别 = "windows.publisherCacheFolders" >


    &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < PublisherCacheFolder >

  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
< 文件夹 名称 = " MyCommonFolder" >

     ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <跨度> <强>< / <跨度>的 PublisherCacheFolder <强>>

        < / 分机 >

  ;&NBSP;&NBSP; < / 扩展程序 >

<跨度> <强>< / <跨度> <强>封装 <强>>

<Package>
    <Extensions>
        <Extension Category="windows.publisherCacheFolders">
            <PublisherCacheFolder>
                <Folder Name="MyCommonFolder">
            </PublisherCacheFolder>
        </Extension>
    </Extensions>
</Package>

在C# 代码隐藏中,按钮点击事件中的代码 如下:

And in the C# codebehind, within a button click event the code is as follows:

StorageFolder sharedDownloadsFolder = ApplicationData.Current.GetPublisherCacheFolder( " MyCommonFolder" );
StorageFolder sharedDownloadsFolder = ApplicationData.Current.GetPublisherCacheFolder("MyCommonFolder");

推荐答案

嗨  user012343210,

Hi user012343210,

你不能
指定路径   as
C:\ Users\user name \AppData \ Local【\\ ApplicationName \ Publisher> \\ pp plicationName \ 。你可以参考这个类似的  螺纹功能?。
作为桌面转换器应用程序,w
如果安装了应用程序包,它就会被复制到系统中。它不运行任何初始化代码。它不知道哪些用户将运行该应用程序,并且无法访问其用户数据。如果第二个用户在应用程序中安装
,那么用户将获得对已安装应用程序的引用,并且不会复制或安装任何新内容。

You can not specify the path as C:\Users\username\AppData\Local\ApplicationName\Publisher\Ap‌​plicationName\. You can refer to this similar thread.  As desktop converter app, when an app package is installed it's just copied into the system. It doesn't run any initialization code. It doesn't know which users will run the app and doesn't have access to their user data. If a second user installs the app then the user gets a reference to the already-installed app and nothing new is copied or installed.

至于您没有找到  ;在MyCommonFolder中的dataFile.txt,在转换应用包中,您可以尝试在VFS文件夹中找到它。有关转换应用文件系统的详细信息,请参阅  文件
系统

As for you don't find the dataFile.txt in the MyCommonFolder, in the convert app package, you can try to find it in the VFS folder. For more details about convert app file system, see File system.

祝你好运,

Breeze


这篇关于[UWP] [桌面转换器]发布者为百年转换应用程序共享文件夹,以使两个应用程序可以访问同一个Publisher共享文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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