Inter application communication in WinRT

后端 未结 4 1427
渐次进展
渐次进展 2021-01-23 00:06

There are two WinRT applications (C#/Xaml if it matters) on Windows 8. The first app should receive and send some data into the second one. What the best way to do that? Can WCF

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-23 00:38

    I am not sure if it has been answered but I found that it is possible to do this using LaunchFileAsync. An example is as follows: //To launch app var launchFileName = "june.kit";

                var folder = Windows.Storage.ApplicationData.Current.LocalFolder;
                var option = Windows.Storage.CreationCollisionOption.ReplaceExisting;
    
                // create file 
                var launchFile = await folder.CreateFileAsync(launchFileName, option);
    
                // write content
                await Windows.Storage.FileIO.WriteTextAsync(launchFile, tempChk);
    
                // launch file
                bool success = await Launcher.LaunchFileAsync(launchFile);
    

    Where launchFileName is possible to have any name with any extension, and this extension should mention in the calling application's FileTypeAssociation in the packager.manifest file.

提交回复
热议问题