本节的主要内容:1.通过代理类的方式调用服务操作.2.通过通道的方式调用服务操作.3.代码下载 一.通过代理类的方式调用服务操作(两种方式添加代理类) 1.手动编写代理类,如下: 客户端契约: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace y.WcfFirst.Client.Proxys { [Se…
//程序事件服务操作 var FMXApplicationEventService: IFMXApplicationEventService; begin if TPlatformServices.Current.SupportsPlatformService (IFMXApplicationEventService, IInterface(FMXApplicationEventService)) then FMXApplicationEventService.SetApplicationEve…
unit Service; interface uses Windows,Messages,SysUtils,Winsvc,Dialogs; function StartServices(Const SvrName:String):Boolean; function StopServices(Const SvrName:String):Boolean; function QueryServiceStatu(Const SvrName: String):String; functio…
看个粟子: 1.“新建项目”——“Window服务” 生成的目录结构 双击“MainService.cs”,右键点击“添加安装程序”,自动会生成Projectinstaller.cs文件以及两个安装组件,对两个组件更名并做属性设置: 对服务的启动与停止添加代码 using System; using System.Diagnostics; using System.IO; using System.ServiceProcess; using System.Timers; namespace Ma…