IPCameraHelper.cs
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using OnlineStore.Common;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration.Install;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class IPCameraHelper
{
//"E:\\Codes\\CSharp-Workspace\\MyProject\\WindowsService\\IPCamService\\bin\\Debug\\IPCamService.exe"
static string appPath = AppDomain.CurrentDomain.BaseDirectory;
//static string serviceFilePath = ConfigHelper.Config.Get("IPCamService_FilePath", $"{appPath}IPCamService\\IPCamService.exe");
//static string serviceName = ConfigHelper.Config.Get("IPCamService_ServiceName", "IPCamService");
/// <summary>
/// 安装服务
/// </summary>
public static void InstallService()
{
//if (!IsServiceExisted(serviceName))
//{
// InstallService(serviceFilePath);
// LogUtil.info("安装监控相机服务");
// ServiceStart(serviceName);
// LogUtil.info("启动监控相机服务");
//}
//else
//{
// ServiceStart(serviceName);
// LogUtil.info("启动监控相机服务");
//}
}
static string baseDir = ConfigHelper.Config.Get("IPCameraService_HttpServer", "http://localhost:8088");
public static void StartRecord(string camName,string fileName="")
{
//Task.Factory.StartNew(delegate {
// string url = $"{baseDir}/cam/startRecord?camName={camName}&filename={fileName}";
// string res = HttpHelper.Get(url);
// LogUtil.info($"开始记录视频:{fileName},{res}");
//});
}
public static void StopRecord(string camName)
{
//Task.Factory.StartNew(delegate {
// string url = $"{baseDir}/cam/stopRecord?camName={camName}";
// string res = HttpHelper.Get(url);
// LogUtil.info($"停止记录视频:{res}");
//});
}
}
}