Windows Services的操作

Windows Services的操作

一.服务的创建:

1.新建项目——Windows服务

2.这是每个人都会犯的错误,新建一个项目后,都会按F5(运行),就会出现如下错误:

3.安装服务有很多种方式,这里就用外部工具的方式来安装:

4.在vs工具栏下拉菜单中就会出现InstallService服务:

5.在上图中点击运行InstallService时会出现如下错误:

这是3图中,参数没有.exe造成的,所以一定要注意,TimeWindowsService.exe

6.如图是没有安装程序造成的错误:

7.service1.cs设计页面中右键-添加安装程序:

8.添加安装程序后,就会创建projectInstaller.cs这个文件:

9.设置属性:

10.安装成功:然后就cmd命令可以操作服务了;

cmd命令:net start 服务名

11.在windows任务管理器中就可以看到自己刚创建的服务了:

时间: 2024-12-18 00:06:30

Windows Services的操作的相关文章

the service mysql56 was not found in the Windows services的解决办法

mysql无法启动,无法改变状态-CSDN论坛-CSDN.NET-中国最大的IT技术社区 http://bbs.csdn.net/topics/390943788   具体描述: 关闭,重启mysql时提示如下错误: the the service mysql56 failed the most recent status change request with the message the service mysql56 was not found in the Windows servic

【转】Windows内核下操作字符串!

* Windows内核下操作字符串! */ #include <ntddk.h> #include <ntstrsafe.h> #define BUFFER_SIZE 1024 VOID DriverUnload(IN PDRIVER_OBJECT pDriverObject) { KdPrint(("DriverUnload Load...\n")); } //==================================================

Windows DIB文件操作详解-4.使用DIB Section

前面讲了为了提高DIB的显示性能和效率,我们将DIB转换成DDB,但是这又遇到一个问题,如果我想操作DIB的数据的话,显然是不能使用DDB:一是因为DIB转DDB时发生了颜色转换,再就是DDB无法直接提取指定像素点的数据.那么我们怎么办呢,Windows使用一种折中的方式来达到这一目标(既提高了显示效率和性能,又可以直接操作像素点). 1.DIB Section存储和显示 Windows使用DIB块(DIB Section)来存储DIB数据,其内存结构示意图如下 其实,和我们自己读入DIB数据到

Windows Services的1053错误的解决办法之一:修改注册表允许的响应时间

Error: 'The service did not respond in a timely fashion' (ServicesPipeTimeout) when attempting when attempting to start, stop or pause a service PROBLEM When attempting to start, stop or pause a service, one of the following error messages is encount

How to start Oracle Windows services

Oracle Tips by Burleson Consulting October 26,  2008 Question:  I need a way to verify that my OEM and isqlplus and Oracle services are started.  How do you start the Oracle services?. Answer: Oracle Windows processes are more difficult to manage as

Windows 下Python操作MySQL

1.环境要求(Win7 X64): python 2.7, MySQL-python-1.2.3.win-amd64-py2.7 :http://www.codegood.com/download/11/  (有需要32位的在这个地方下载https://pypi.python.org/pypi/MySQL-python) 注意:请看清楚自己的电脑位数,如果64位的系统使用32位的安装包会报如下错误: ImportError: DLL load failed: %1 不是有效的 Win32 应用程

Windows DIB文件操作详解-1.DIB的读入、保存和显示

DIB(设备无关位图)是存储在磁盘上的位图文件,可以从磁盘读到内存中或从内存保存到磁盘上,它的磁盘文件结构是标准化的,在Linux.Unix及Windows上都可以以同样效果显示.位图是最接近硬件的图像格式,Windows显示的核心是位图,它的SDK API专门提供了一组用于操作DIB文件的函数.但是由于这样或那样的原因,高效合理的使用这些DIB API是需要了解不少历史和使用背景的,在这里我抽茧剥丝介绍和演示DIB的使用,相信对你更好的使用DIB文件有帮助,由于DIB函数比较多,这里分为三部分

当程序以Windows Services形式启动时当前路径不对

很多时候我们需要将我们的程序写成利用Windows服务的形式来让它能够自启动.今天遇到一个问题,当一个程序注册成Windows Services的形式启动的话,当前程序的CurrentDirectory会被设置成系统目录C:\WINDOWS\system32.这样子的话如果你原先程序里访问一些相对路径的资源的话就会出错误,所以需要显示的将当前路径设置到运行程序所在的路径. System.IO.Directory.SetCurrentDirectory(System.AppDomain.Curre

C# ClickOnce deployment for Windows Services ClickOnce 部署windows service

A simple solution that I use is to merely stop the service and x-copy the files from my bin folder into the service folder. A batch file to stop the service then copy the files should be easy to throw together. Net stop myService xcopy \\myServerWith