Process.start无法在C#窗口服务中工作。 [英] Process.start not working in C# window service.

查看:94
本文介绍了Process.start无法在C#窗口服务中工作。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



i希望从窗口服务开始处理,没有任何错误就无法正常工作。

我的文档没有打印。



但是当我在windows应用程序中使用此代码时,它的工作正常。



请帮帮我。



在此先感谢。



Ankit Agarwal

软件工程师



我尝试过:



Hello,

i want to process start from window service, it's not working without any error.
my document is not printing.

but when i use this code with windows application, So its working perfectly.

please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer

What I have tried:

ProcessStartInfo info = new ProcessStartInfo(file);
                       info.Verb = "Print";
                       info.CreateNoWindow = true;
                       //info.UseShellExecute = false;
                       info.WindowStyle = ProcessWindowStyle.Hidden;
                       Process.Start(info);

推荐答案

用户在运行服务的帐户下是否有安装打印机,访问必要的文件等?该服务在一个单独的会话中运行,可能在不同的帐户下运行,因此您需要确保所有必要的配置都已到位。
Does the user, under which account you're running the service, have the printer installed, access to necessary files etc?. The service is run in a separate session, possibly under a different account, so you need to make sure that all necessary configurations are in place.


这篇关于Process.start无法在C#窗口服务中工作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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