C#开发、部署Windows Services服务
来源:互联网 发布:万彩动画大师for mac 编辑:程序博客网 时间:2024/05/21 07:21
- 1:创建一个Windows Services项目(我用的是VS2012)
- 2:生成一下(注意,不是F5,该项目是不能运行的)
- 3:安装项目
1):切换到服务的Design视图(右键属性,可修改服务名称,不修改的话,默认服务名与项目名称一样,我的修改为”MyService1“了)。
2):右键“设计视图”,单击“添加安装程序”(这时项目中就添加了类 ProjectInstaller 和两个组件 ServiceProcessInstaller 和 ServiceInstaller, 并且服务的属性值被复制到组件。)
3):若要确定如何启动服务,请单击 ServiceInstaller 组件并将 StartType 属性设置为适当的值。(默认是手动)
4):单击serviceProcessInstaller组件,将他的Account属性改为 LocalSystem 这样,不论是以哪个用户登录的系统,服务总会启动。
5):重新生成解决方案(生成一个可执行文件,我的项目路径是:
E:\学习\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe
- 4:部署服务
打开cmd ,输入InstallUtil.exe的绝对路径 + windows服务程序编译后的.exe程序的绝对路径,回车就行了
回车后提示:
启动服务:在命令行内输入: net start 服务名称 如果需要终止服务,输入:net stop 服务名称(服务名称不一定是可执行文件名称,即服务名称不一定是项目名称,服务名称是在服务属性中自己设置的)
这样就可以了,此时就可以在服务中查看了,OK了
0 0
- C#开发、部署Windows Services服务
- C# Windows Services 服务
- c#开发Windows服务程序及部署
- 用c#开发部署windows服务
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- 用C#创建Windows服务(Windows Services)
- ZBar 支持i386 armv6 armv7 armv7s x86_64 arm64
- TCP的那些事儿
- 数据结构中的树
- VS2012 创建项目未找到与约束匹配的导出
- AES For Delphi And Java, AES/ECB/PKCS5Padding(一)
- C#开发、部署Windows Services服务
- 软件工程综合性实验 - 图书馆管理系统的需求分析
- C++异常处理机制
- JavaScript中的indexOf
- c#编程 验证身份证问题
- 延迟脚本和异步脚本
- php版本的九九乘法表
- atitit. js 跨界面 页面 web cs 传值方法总结
- ,预计今天已经让他更为访问