登录
首页 » 其他 » C#启动Windows IIS服务的实例

C#启动Windows IIS服务的实例

于 2022-02-13 发布 文件大小:37.23 kB
0 288
下载积分: 2 下载次数: 1

代码说明:

C#启动指定的Windows信使服务,本例中是启动IIS服务,在Windows XP下可完美运行,在Windows7下不行好像,本程序演示如何在C#的程序中启动一个指定的Windows内置服务的方法。具体的实现代码:   ServiceController service = new ServiceController();//创建服务控制对象   service.ServiceName = "Messenger";//启动Windows信史服务   //判断当前服务状态   if (service.Status == ServiceControllerStatus.Stopped)   {    try    {    service.Start();// 启动服务    service.WaitForStatus(ServiceControllerStatus.Running);    }    catch (InvalidOperationException)    {    MessageBox.Show("不能启动该服务!");    }   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Plug
    插件安装: 下载插件,将插件目录放入wp-content/plugins/目录下 插件管理页面激活插件 去模板widget页面增加blogshout的widget 在插件设置页面或者博客首页或者widget页面修改通告内容 -Plug-ins installed: Download plug-in, plug-ins directory Add to wp-content/plugins/directory under the plugin management page to activate plug-ins to increase blogshout page template widget in the widget plugin settings page or blog page or widget page modified circular content
    2023-05-07 04:40:02下载
    积分:1
  • Can choose the Chinese version of the electronic design interface automatically...
    可以选择中文版操作界面的电子设计自动...书中介绍如何用HQL编写Hibernate查询,如何结合使用Hibernate和基于Java的Criteria与Example。同时还详细介绍Hibernate的映射-Can choose the Chinese version of the electronic design interface automatically ... the book describes how to use Hibernate prepared HQL query, how to combine the use of Hibernate and Java-based Criteria and Example. At the same time, also gave details of Hibernate mapping
    2022-09-16 10:45:03下载
    积分:1
  • OPNET
    OPNET 的开发源码 希望有帮助 -OPNET
    2023-03-10 01:10:03下载
    积分:1
  • 这是一个反汇编工具,可以支持PIC,51,AVR系列的芯片
    这是一个反汇编工具,可以支持PIC,51,AVR系列的芯片-This is an anti-compilation tool that can support the PIC, 51, AVR series chips
    2022-09-02 17:05:03下载
    积分:1
  • Calculation of parametres for the task of frequency for microprocessors MSP430
    Calculation of parametres for the task of frequency for microprocessors MSP430
    2022-03-21 05:43:02下载
    积分:1
  • 系统清理程序,可以清理系统中的垃圾文件。例如IE的缓存,系统的缓冲区等...
    系统清理程序,可以清理系统中的垃圾文件。例如IE的缓存,系统的缓冲区等
    2022-03-25 16:45:27下载
    积分:1
  • 使用IrisSkin2控件的C#漂亮关机程序
    使用IrisSkin2控件的C#漂亮关机程序,本程序可学习到两个亮点,1、换肤控件IrisSkin2的应用实例,2、C#实现关机。这种关机程序的界面效果可选择5种样式:MSN风格、Vista风格、经典风格等,关机功能可以在设定时间后自动程序,编译环境vs2008。
    2022-07-13 08:04:15下载
    积分:1
  • 刚开始学习的人,一个简短的介绍,产生了典型的一。
    对于刚开始学习ps的人来说,有一本简单介绍制作典型图像效果的书,是件有意义的事,这本书会给你帮助-just started learning for the people ps, a brief introduction produced typical images of the book is a meaningful thing, this book will help you
    2022-03-14 09:10:53下载
    积分:1
  • 手机版的俄罗斯方块程序 休闲内的手机游戏。
    手机版的俄罗斯方块程序 休闲内的手机游戏。-Russia block on mobile platform,which is mobile game for rest.
    2022-05-22 18:08:59下载
    积分:1
  • 续接上面16*16VHDL 程序,可作参考,大家互相学习3
    续接上面16*16VHDL 程序,可作参考,大家互相学习3-Then added 16* 16VHDL procedures above can be used for reference, we learn from each other 3
    2022-03-04 13:36:36下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载