用metro应用程序启动桌面程序? [英] Launching a desktop program with metro app?

查看:107
本文介绍了用metro应用程序启动桌面程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人问这里如果Windows 8中的地铁应用程序可以启动桌面程序,答案是否,因为地铁应用程序是沙盒。



然而,我发现这个页面中一个有趣的答案:



---



我找到了一个适合我的解决方案。我刚刚在我的应用程序中创建了一个空文本文件并将其命名为 launcher.yourappyouwanttostart 然后执行它



< pre lang =c#> Windows.System.Launcher.LaunchFileAsync( launcher.yourappyouwanttostart);





在第一次启动时它会询问你这个文件的关联,然后你选择你要运行的exe文件从现在开始每次执行此文件时,您的应用程序都将启动。




---



我是新手,并不是很明白他的意思:/制作一个空文本文件?在哪里,如何?



非常感谢帮助:)

解决方案

微软真的放弃了允许1个应用程序启动另一个应用程序,这种技术存在许多安全漏洞,最大的一个是命令注入漏洞。微软对这个问题的解决方案就是使用所谓的启动器,启动器本身并没有直接启动另一个应用程序,就像在C ++中你只需要调用系统(你的命令)那样。或者在地铁前,您将启动诊断过程。相反,启动器,即已经存在一段时间的Microsoft技术直接调用操作系统,启动与此类文件关联的应用程序。



Microsoft允许您将文件扩展名与应用程序相关联,通过右键单击文件,查看上下文菜单和打开方式选项。因此,Microsoft允许您建立该关联,并且通过该关联,Windows,更具体地说,Windows 8将确定用于打开该文件扩展名的最佳应用程序。



而不是你打电话给记事本,通过诊断程序打开文本文件,现在你将调用启动器,打开你想要打开的文件,启动器/操作系统将确定打开应用程序的应用程序和最安全的方法。


It was asked here if a metro app in windows 8 can launch a desktop program and the answer was "no" because metro apps are "sandboxed".

However, I found an interesting answer in this page:

---

I found a solution which is suitable for me. I just made an empty textfile in my app and called it launcher.yourappyouwanttostart and then executed it with

Windows.System.Launcher.LaunchFileAsync("launcher.yourappyouwanttostart");



On the first startup it asks you for the assocation for this file and then you choose the exe file you want to run and from now on every time you execute this file, your app will be started.


---

I''m new and don''t really understand what he means :/ make an empty textfile? Where, how?

Help is much appreciated :)

解决方案

Microsoft is really moving away from allowing 1 app to launch another app, there are many security vulnerabilities associated with such a technology, the biggest one being the command injection vulnerability. Microsoft''s solution to this problem was to use what is known as the launcher, the launcher doesn''t directly launch another application itself, as you would in the days of C++ where you would just call system("Your command") or pre metro where you would fire up a diagnostic process. Rather the launcher, which is, a Microsoft technology that''s been around for a while directly calls the OS, to launch the application associated with such a file.

Microsoft allows you to associate file extensions with applications, see the context menu & the "open with" option by right clicking on a file. So Microsoft allows you to make that association and it''s through that association that Windows, and more specifically windows 8 will determine the best possible application to open that file extension with.

Rather then you calling note pad, to open a text document through the diagnostic processes, you will now call the launcher, with the file you want to open, and the Launcher/OS will determine which application and the safest way to open the application.


这篇关于用metro应用程序启动桌面程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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