如何使用WPF窗口从任何计算机上的桌面文件夹启动应用程序 [英] How To Use A WPF Window To Launch An Application From Desktop Folder On Any Machine

查看:66
本文介绍了如何使用WPF窗口从任何计算机上的桌面文件夹启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在互联网上搜索关于此的一些教程,但我没有说明这一点。

I keep searching the Internet for some sort of tutorial on this but none I've fount make it very clear.

我在Visual Studio中创建了一个WPF窗口有两个按钮

I've created a WPF Window in Visual Studio that has two Buttons

按钮一用于启动PDF文件。

Button One Is to be used to launch a PDF File.

按钮2用于启动.exe应用程序然后关闭WPF窗口

Button Two is to be used to launch the .exe application and then close the WPF window

现在我发现如果我使用:

Now I find that if I use:

Process.Start(" C:/ Users / mdkgr / Desktop) /FolderName/app.exe

Process.Start("C:/Users/mdkgr/Desktop/FolderName/app.exe

然后它工作,但是,当我发布这个项目并且人们要在他们的机器上使用它时,这种方法无效,因为地址无疑会对于它安装的每台机器都不同。

Then it works, however, naturally when I publish this project out and people are to use it on their machine this method will not work because the address will no doubt be different for every machine it's installed on.

我的问题很简单:

我如何制作它以便启动PDF文件或application.exe在它安装的任何机器上?

My question is simply:
How do I make this so it will launch either the PDF file or application.exe on any machine it's installed on?

我见过的Visual Studio教程都没有说清楚。 

None of the Visual Studio tutorial I've seen make this very clear. 

推荐答案

嗨朋友nd,

欢迎来到MSDN论坛。

Welcome to the MSDN forum.

请参阅您的说明,您的问题与WPF论坛有关。由于我们的论坛是讨论VS IDE,我将帮助您将此主题移至相应的论坛以获得更好的支持,感谢您的理解。

Refer to your description, your issue is about the WPF forum. Since our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.

致以最诚挚的问候,

Sara


这篇关于如何使用WPF窗口从任何计算机上的桌面文件夹启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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