{"id":19029165,"url":"https://github.com/aileshe/srvman","last_synced_at":"2026-06-23T11:32:51.501Z","repository":{"id":226139019,"uuid":"187667409","full_name":"aileshe/SrvMan","owner":"aileshe","description":"A simple windows service manage class in C++.","archived":false,"fork":false,"pushed_at":"2019-05-20T15:41:30.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T20:13:14.051Z","etag":null,"topics":["cpp"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aileshe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-05-20T15:27:40.000Z","updated_at":"2024-07-27T14:49:17.000Z","dependencies_parsed_at":"2024-03-06T04:25:28.358Z","dependency_job_id":"d8190c0c-d131-42dd-abf5-b6d0870a740f","html_url":"https://github.com/aileshe/SrvMan","commit_stats":null,"previous_names":["aileshe/srvman"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aileshe/SrvMan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aileshe%2FSrvMan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aileshe%2FSrvMan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aileshe%2FSrvMan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aileshe%2FSrvMan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aileshe","download_url":"https://codeload.github.com/aileshe/SrvMan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aileshe%2FSrvMan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34686727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp"],"created_at":"2024-11-08T21:13:25.893Z","updated_at":"2026-06-23T11:32:51.485Z","avatar_url":"https://github.com/aileshe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SrvMan\nA simple windows service manage class in C++.\n简单的windows service管理 C++封装类\n\n## 下载安装:\n```\ngit clone https://github.com/aileshe/SrvMan.git\n```\n\n## 使用 Sample:\n```\n#include \u003ciostream\u003e\n#include \"SrvMan.h\"\nusing namespace std;\nusing namespace sc; \n\nint main(int argc, char **argv)\n{\n\n\t// 服务名称\n\tconst wchar_t* service_name = L\"MyTestService\";\n\n\t// 判断服务是否存在\n\tif (sc_has(service_name))\n\t\tcout \u003c\u003c \"服务存在!\" \u003c\u003c endl;\n\telse\n\t\tcout \u003c\u003c \"服务不存在!\" \u003c\u003c endl;\n\n\t// 启动服务\n\tif (sc_run(service_name))\n\t\tcout \u003c\u003c \"服务启动成功!\" \u003c\u003c endl;\n\telse\n\t\tcout \u003c\u003c \"服务启动失败!\" \u003c\u003c endl;\n\n\t// 暂停服务\n\tif (sc_stop(service_name))\n\t\tcout \u003c\u003c \"服务暂停成功!\" \u003c\u003c endl;\n\telse\n\t\tcout \u003c\u003c \"服务暂停失败!\" \u003c\u003c endl;\n\n\n\t// 创建服务\n\t/*\n\tPWSTR szPath,         // 服务程序路径\n\tPWSTR pszServiceName, // 服务名称\n\tPWSTR pszDisplayName, // 显示名称\n\tDWORD dwStartType,    // 启动类型  SERVICE_AUTO_START,SERVICE_DEMAND_START...\n\tPWSTR pszDependencies,// List of service dependencies - \"dep1\\0dep2\\0\\0\", 一般填空 L\"\"\n\tPWSTR pszAccount,     // 登录用户, L\"NT AUTHORITY\\\\LocalService\" or L\"NT AUTHORITY\\\\SYSTEM\" or L\"NT AUTHORITY\\\\NETWORK SERVICE\"\n\tPWSTR pszPassword     // 用户密码, 一般填空 NULL\n\t*/\n\tif (sc_create(\n\t\tL\"C:/Program Files/MyTestService/MyTestService.exe\",\n\t\tservice_name,\n\t\tservice_name,\n\t\tSERVICE_AUTO_START,\n\t\tL\"\",\n\t\tL\"NT AUTHORITY\\\\SYSTEM\",\n\t\tNULL\n\t))\n\t\tcout \u003c\u003c \"创建服务成功!\" \u003c\u003c endl;\n\telse\n\t\tcout \u003c\u003c \"创建服务失败!\" \u003c\u003c endl;\n\n\n\t// 删除服务\n\tif (sc_remove(service_name))\n\t\tcout \u003c\u003c \"删除服务成功!\" \u003c\u003c endl;\n\telse\n\t\tcout \u003c\u003c \"删除服务失败!\" \u003c\u003c endl;\n\n\n\tgetchar();\n\treturn 0;\n}\n\n```\n## 联系方式\nAuthor: Dejan\n\nQQ: 673008865\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faileshe%2Fsrvman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faileshe%2Fsrvman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faileshe%2Fsrvman/lists"}