摘要: 一、安装服务 1、已管理员的身份启动CMD 2、输入 cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 回车 3、输入 InstallUtil.exe Window服务软件路径.exe 回车 二、卸载服务 1、卸载很简单,打开cmd, 直接输入 sc delete WinServiceTest便可 阅读全文
posted @ 2016-10-10 11:24 microsoftzhcn 阅读(1334) 评论(0) 推荐(0)
摘要: public static void Start() { ThreadStart start = new ThreadStart(ThreadAction); Thread th = new Thread(start); th.IsBackground = true; th.Start(); } public static void ThreadAction() ... 阅读全文
posted @ 2016-10-10 11:22 microsoftzhcn 阅读(736) 评论(0) 推荐(0)
摘要: #region 设置程序开机自动运行(+注册表项) RegistryKey rgkRun = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (rgkRun == null) { rgkRun = Registry.LocalMachine.Cr... 阅读全文
posted @ 2016-10-10 11:20 microsoftzhcn 阅读(2514) 评论(0) 推荐(0)
摘要: #region 创建桌面快捷方式 string deskTop = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop); string dirPath = System.Environment.CurrentDirectory; string exePath = Assemb... 阅读全文
posted @ 2016-10-10 11:19 microsoftzhcn 阅读(2589) 评论(0) 推荐(0)