2011年7月25日
摘要: 在OnStart和OnStop方法中添加服务启动和停止时的处理代码 protected override void OnStart(string[] args) { } protected override void OnStop() { } 还需要添加Installer才能加载服务,在Service类的设计界面 右键-> Add Installer。 在Installer类中,serviceInstaller属性:ServiceName,StartType;设置serviceProcessInstall... 阅读全文
posted @ 2011-07-25 22:58 PeterZhang 阅读(1093) 评论(0) 推荐(0)
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Runtime.InteropServices; 4 using System.Security.Principal; 5 using System.Text; 6 7 namespace SystemUsers 8 { 9 class Program10 {11 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]12 public struct USER_INFO_013 {14 . 阅读全文
posted @ 2011-07-25 21:59 PeterZhang 阅读(5111) 评论(0) 推荐(0)