some note on studying C# win service coding
来源:互联网 发布:js设置readonly 编辑:程序博客网 时间:2024/06/02 00:51
C#
create win service program:
确保 ProjectInstaller.cs 视图设计器中的 serviceInstaller1 组件的 ServiceName 属性
与 Service1.cs 组件的 ServiceName 属性一致
我们发现大多数情况下,C#调用Process.Start根本不会出错。这个错误通常出现在当你使用Local System帐号运行程序时,例如我们有一个windows服务,此服务调用Process.Start创建新进程时,新进程及其所有的子进程都是以System帐号运行的。这时调用Process.Start就有可能出现此错误,只是有可能,其实在我们那么多机器上只有一台运行windows 2003的服务器出现了这个错误。可能与系统设置有关,深层原因有待考察。
解决方法:
只要修改代码,设置ProcessStartInfo的UseShellExecute=false即可
[code]
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = exepath;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
Process.Start(psi);
0 0
- some note on studying C# win service coding
- some note
- Some note on using Hivesdfwq-0.123312.0.2.0.6.0-0009
- some step in studying android
- some studying matlab notes(reprinted)
- Studying note 1 of mysql
- My Linux Studying Note(二)
- android note of studying-----DataBase
- Java Web Service Studying
- some note about js
- c++ note some detail
- Andorid--Application some note
- note:some learn remark
- shell coding note
- C++ Coding Note
- coding note-源码搜索
- C++ Coding Tricks Note
- Note 07/08/02 some question about js on Asp.Net : Vss 6.0
- DHT文章
- 游戏架构
- Android 巧用Itent.ACTION_PICK和Intent.ACTION_GET_CONTENT(三)
- Ios17个常用代码整理
- EL 表达式详解
- some note on studying C# win service coding
- 绝对震撼 10个实用的jQuery/HTML5插件
- 23种设计模式(12):策略模式
- 卡尔曼滤波原理说明
- iOS开发常用国外网站清单
- ZOJ 132月赛解题报告
- request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPat
- 实现接口的实现类,实现类方法调用
- loadView学习总结