国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

create and Control Windows Services--introduction[

2024-07-21 02:21:28
字體:
來源:轉載
供稿:網友
  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。
  • windows services (formerly known as nt services) can seem overwhelming and daunting to the uninitiated because of a vast array of callback functions and long parameter lists. even though creating services in c++ almost ensures top-notch performance, the complexity factor might outweigh that fact. however, with the recent release of the .net framework sdk, the complexity of creating and controlling services has diminished. if development time is of the essence, visual c#.net and the .net framework prove invaluable assets.

    what you need:
    .net framework sdk, windows nt4 or windows 2000   



    in this article, i'll demonstrate the necessary steps to create a windows service, then explain how to control your service by creating a useful utility that could prove invaluable as you test and debug your service. but first let me give you some background on windows services.

    most of us remember terminate-and-stay-resident (tsr) programs—ones that remained in memory after being executed but gave control back to the user. as useful as they were, you faced the occasional compatibility problem in the environment you ran them in. system architectures inevitably increased in reliability and multitasking capabilities, and the tsr gave rise to what we now call the service.

    a service is an executable that gives the operating system nonintrusive functionality. a service installed and configured to run automatically begins execution before a user logs on to the computer. some common uses for services include hardware control and monitoring applications; system-level utility, diagnostic, and reporting tools; and communication software such as a web or file-system server.

    although a service is an executable, you can't start and terminate it through traditional means. the first and most common way to start one: register it with the service control manager as an automatic service. this ensures the service starts as soon as the machine has finished the boot cycle and before a user logs on to the system. you can also start a service manually using the console command net start <servicename> or through the service applet within the windows administrative tools group.

    services also can allow you to pause and continue during execution, either manually or programmatically. but providing this functionality is up to the service designer—it's not required.

    just as a service doesn't start as other executables do, it also can't terminate the same way many other executables can. the service itself generally has no user interface associated with it, so it terminates when the user turns off or restarts the system, or manually stops the service using the service applet again or with the net stop <servicename> console command.

    you must follow special rules while creating a service to get it to run correctly within the system environment. the most important: you must install or register a service within the system it intends to run in. in other words, you can't just run a service by double-clicking on its executable file. furthermore, a service shouldn't provide a user interface. rather, it should do its reporting with the system event log or performance counters. i'm not saying services can't have a user interface, but each service is created within in its own windows station, so ui-related api calls might not succeed. finally, a service must support a number of methods i'll discuss later to control its execution life cycle.
    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 安多县| 新民市| 宜宾县| 临桂县| 丹凤县| 临沧市| 阆中市| 精河县| 陵川县| 惠来县| 湟中县| 长汀县| 文登市| 广东省| 永福县| 临高县| 宜城市| 济南市| 潞城市| 京山县| 呼伦贝尔市| 夏邑县| 武宁县| 孟连| 万山特区| 济南市| 当阳市| 巴青县| 阿瓦提县| 三原县| 凤翔县| 武功县| 罗定市| 奉新县| 丽水市| 乐都县| 乐都县| 沙湾县| 轮台县| 吉安市| 齐河县|