从Windows服务/ .Net表单应用程序启动metro应用程序 [英] start metro app from Windows Service / .Net form application
问题描述
我已经根据PC安全性和工作正常制作了我的地铁应用程序。
我想在Windows Startup上启动这个Metro应用程序,因为我有制作Windows服务,以便它可以启动我的地铁应用程序。
问题:如何从Windows服务启动地铁应用程序?
我用google搜索了很多但是找不到任何适合我的解决方案..
任何改变应该在我的地铁应用程序中完成所以它可以从其他过程开始??
我已经尝试过现在:
方法 - 1
Process.Start( redhawk:\ \)
我已将redhawk作为我的地铁应用程序的协议名称。
方法-2
Process.Start( metro.bat)
和conten
metro.bat
的ts如下:
start redhawk:
注意:第二种方法启动我的地铁应用程序,但它停留在启动画面。我应该在地铁应用程序中更改某些内容以避免这种情况吗?
我也读过有关OnActivated()事件但无法成功应用它。
请尽快帮助我......提前致谢...
我不相信这是可能的。 Windows 8应用程序所采取的每个操作都必须通过用户交互来完成,因此自动启动它将违反该规则。但是,您应该能够添加后台任务,以便在应用程序未运行时在后台收集数据。你考虑过吗?
这是一个很好的示例,展示了如何在JS,C#,VB和C ++中实现后台代理:
http://code.msdn.microsoft.com/windowsapps/Background-Task-样品9209ade9
I have already made my metro app based on PC security and its working fine.
I want to start this metro app on Windows Startup, for that i have made a Windows Service so that it can start my metro app.
Problem : How to start a metro app from Windows Service ?
I have googled it alot but couldn''t find any solution working for me..
Any change shouldd be done in my metro app so that it can start from other process ??
I have tried till Now :
Method-1
Process.Start("redhawk:\\")
I have given "redhawk" as my metro app''s protocol name.
Method-2
Process.Start("metro.bat")
And the contents of
metro.bat
is as follows :
start "" "redhawk:"
Note : The 2nd method starts my metro app but it stucks on the splash screen. Should i change something in my metro app to avoid this ??
I have also read about OnActivated() event but couldn''t apply it successfully..
Please Help Me As Soon As You Can... Thanks in advance...
I don't believe this is possible. Every action a Windows 8 application takes must be made by user interaction, and so starting it automatically would be against that rule. You should, however, be able to add a background task that can gather data in the background while your app isn't running. Have you considered that? here's a great sample that shows how to implement a background agent, in JS, C#, VB, and C++:
http://code.msdn.microsoft.com/windowsapps/Background-Task-Sample-9209ade9
这篇关于从Windows服务/ .Net表单应用程序启动metro应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!