如何使用C#从Windows Service运行exe程序 [英] How to run exe program from windows service using c#
本文介绍了如何使用C#从Windows Service运行exe程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
如何使用C#从Windows Service运行exe程序.
这是mycode:
Hello,
How to run exe program from windows service using c#.
This is mycode:
System.Diagnostics.Process.Start(@"E:\PROJECT XL\INI SQLLOADER\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe");
当我运行此服务时,不会发生.请告诉我我的代码有什么问题.谢谢
When i run this service not happening. Please tell me whats wrong with my code. Thanks
推荐答案
该服务处于系统级别.但是您的应用程序必须在用户级别运行.您需要对此进行调整.
首先,请按照此处的讨论进行操作.
http://stackoverflow.com/questions/267838/how- can-a-windows-service-execute-a-gui-application [
The service is at the system level. But your application has to run at user level. You need a tweak for that.
To start with follow discussions here.
http://stackoverflow.com/questions/267838/how-can-a-windows-service-execute-a-gui-application[^]
An additional point you may try to run your console app as admin
这篇关于如何使用C#从Windows Service运行exe程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文