ClickOnce的AP pref.ms参数 [英] ClickOnce appref.ms argument
问题描述
我有一个ClickOnce应用程序是在线还是离线使用。该方案需要一个参数。当在线我传递像这样网址是什么?说法的URL参数,它工作得很好。离线我启动一个进程与STARTMENU链接到应用程序。
I have a ClickOnce application that is available online or offline. The program takes an argument. When online I pass the argument on the URL like so "url?argument", and it works well. Offline I start a process with the startmenu link to the application.
是否有可能通过该链路传递的参数,我的应用程序?我想我能以某种方式制定出应用程序文件的位置,但有别的选择吗?
Is it possible to pass an argument to my application via this link? I guess I could somehow work out the location of the application file, but is there an alternative?
推荐答案
我能够得到这个被引用的应用程序为$ USERPROFILE \桌面\你的快捷方式名称Here.ap preF-MS的工作
I was able to get this to work by referencing the app as "$userprofile\Desktop\Your Shortcut Name Here.appref-ms"
然后,通过PARMS,将它们作为像这样一个单一的,没有空间的实体:ARG1,ARG2,ARG3
Then, to pass the parms, pass them as a single, no space entity like so: arg1,arg2,arg3
整个事情看起来像这样在命令行上:
The whole thing looks like this on the command line:
"$userprofile\Desktop\Your Shortcut Name Here.appref-ms" arg1,arg2,arg3
然后在你的code,使用
Then in your code, use
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0]
要检索的args。
我的博客上讲述这个昨天:<一href="http://www.developingfor.net/net/processing-command-line-arguments-in-an-offline-clickonce-application.html" rel="nofollow">http://www.developingfor.net/net/processing-command-line-arguments-in-an-offline-clickonce-application.html
I just blogged about this yesterday: http://www.developingfor.net/net/processing-command-line-arguments-in-an-offline-clickonce-application.html
这篇关于ClickOnce的AP pref.ms参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!