zoukankan      html  css  js  c++  java
  • C#实现Windows 服务的制作安装和删除[转]

    关于C#实现windows服务的制作与安装还有删除
    运行Visual Studio.NET,建立一个C#的Windows服务项目。
    主程序代码:
    以下是引用片段:
    Code
    添加安装组件:
      在设计页面上点右键,出现菜单后,选择添加安装程序。这时会出现一个新的页面,页面上有个控件 serviceProcessInstaller1和serviceInstaller1
      在 serviceProcessInstaller1中把属性Account改为LocalSystem
      在把serviceInstaller1中把属性Parent 改为serviceProcessInstaller1 ServiceName属性是管生成服务后的名子
      添加完成之后,生成一下(假设名为W2.exe)。到相应的文件夹找到生成的exe文件,找到时会发现有两个.exe用名子比较短的那个。把这个文件拷到一个好记的文件夹中如F盘根目录。
      这时就是要把个服务安装一下。进入cmd中的画面,进入Framework2.0的文件如:
      cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
      后在打
      InstallUtil f:\w2.exe 这个就安装了服务 卸载服务是 InstallUtil f:\w2.exe -u

      现在就剩启动服务了,
      到windows服务里启动你安装的服务就可以了。
  • 相关阅读:
    GPUImage滤镜效果翻译
    c3p0配置
    Android webview Mixed Content无法显示图片解决
    java连接jdbc Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by defa
    Castle DynamicProxy creation出现COMException(0x800703fa)错误的解决方案
    magent实现memcached集群的一个问题
    近期Windows 10 RedStone 2 Insider版本安装进度停留在百分之23、24解决方案
    XPS 15 9530使用Windows10频繁发生Intel HD Graphics 4600驱动奔溃的一种解决方法
    Visual Studio 2015开发Android App启动调试始终无法完成应用部署的解决方案
    Visual Studio 2015中创建C#的Android项目提示"Value cannot be null"的解决方法
  • 原文地址:https://www.cnblogs.com/qiangshu/p/1610228.html
Copyright © 2011-2022 走看看