-
大小: 69.53MB文件类型: .rar金币: 2下载: 1 次发布日期: 2022-08-31
- 语言: C#
- 标签:
资源简介
大华摄像头最新完整的winform调用测试代码-视频,抓拍,录像等功能均有,完胜所有的例子
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetSDKCS;
using System.Windows.Threading;
using System.Runtime.InteropServices;
namespace NetClient
{
public class AlarmClient : baseClient
{
private AlarmEventManager m_AlarmEventManager;
private bool m_IsStop = true;
public event AlarmEventHandler AlarmReceived;
internal void OnAlarmReviced(object sender AlarmEventArgs args)
{
if (AlarmReceived != null)
{
IntPtr n_LoginID = (IntPtr)sender;
if (n_LoginID == LoginID)
{
AlarmReceived(this args);
}
}
}
public AlarmClient()
{
m_AlarmEventManager = AlarmEventManager.GetInstance();
}
~AlarmClient()
{
if (!m_IsStop)
{
StopListen();
}
}
public void StartListen()
{
m_AlarmEventManager.AddEvent(OnAlarmReviced);
try
{
NETClient.StartListen(LoginID);
m_IsStop = false;
}
catch (NetSDKCS.NETClientExcetion ex)
{
m_AlarmEventManager.RemoveEvent(OnAlarmReviced);
throw new NETClientExcetion(ex.ErrorCode ex.Message);
}
}
public void StopListen()
{
m_AlarmEventManager.RemoveEvent(OnAlarmReviced);
if (LoginID != IntPtr.Zero)
{
try
{
NETClient.StopListen(LoginID);
m_IsStop = true;
}
catch (NetSDKCS.NETClientExcetion ex)
{
throw new NETClientExcetion(ex.ErrorCode ex.Message);
}
}
}
public override void Logout()
{
m_AlarmEventManager.RemoveEvent(OnAlarmReviced);
base.Logout();
}
public override void Dispose()
{
m_AlarmEventManager.RemoveEvent(OnAlarmReviced);
base.Dispose();
}
}
public sealed class AlarmEventManager : Dispatcherobject
{
private readonly fMessCallBackEx m_AlarmCallBack;
private event AlarmEventHandler m_AlarmReceived;
private void OnAlarmReviced(object sender AlarmEventArgs args)
{
if (m_AlarmReceived != null)
{
m_AlarmReceived(sender args);
}
}
private AlarmEventManager()
{
m_AlarmCallBack = new fMessCallBackEx(AlarmCallBackEx);
NETClient.SetDVRMessCallBack(m_AlarmCallBack IntPtr.Zero);
}
~AlarmEventManager()
{
m_AlarmReceived = null;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 32342 2017-05-05 10:10 YW.VideoSrv\NetClient\AlarmClient.cs
....... 18399 2017-05-05 10:10 YW.VideoSrv\NetClient\ba
....... 6034 2017-05-05 10:10 YW.VideoSrv\NetClient\ba
文件 68608 2017-09-26 10:48 YW.VideoSrv\NetClient\bin\Debug\NetClient.dll
文件 132608 2017-09-26 10:48 YW.VideoSrv\NetClient\bin\Debug\NetClient.pdb
文件 103936 2017-09-26 10:48 YW.VideoSrv\NetClient\bin\Debug\NetSDKCS.dll
文件 40448 2017-09-26 10:48 YW.VideoSrv\NetClient\bin\Debug\NetSDKCS.pdb
....... 68096 2017-06-16 16:49 YW.VideoSrv\NetClient\bin\x64\Debug\NetClient.dll
....... 136704 2017-06-16 16:49 YW.VideoSrv\NetClient\bin\x64\Debug\NetClient.pdb
....... 103936 2017-06-16 16:49 YW.VideoSrv\NetClient\bin\x64\Debug\NetSDKCS.dll
....... 40448 2017-06-16 16:49 YW.VideoSrv\NetClient\bin\x64\Debug\NetSDKCS.pdb
....... 68608 2017-06-16 16:57 YW.VideoSrv\NetClient\bin\x86\Debug\NetClient.dll
....... 128512 2017-06-16 16:57 YW.VideoSrv\NetClient\bin\x86\Debug\NetClient.pdb
....... 103936 2017-06-16 16:56 YW.VideoSrv\NetClient\bin\x86\Debug\NetSDKCS.dll
....... 40448 2017-06-16 16:56 YW.VideoSrv\NetClient\bin\x86\Debug\NetSDKCS.pdb
....... 4192 2017-05-05 10:10 YW.VideoSrv\NetClient\ClientEventArgs.cs
....... 724 2017-05-05 10:10 YW.VideoSrv\NetClient\ClientHandler.cs
....... 1155 2017-05-05 10:10 YW.VideoSrv\NetClient\ClientManager.cs
....... 26557 2017-05-05 10:10 YW.VideoSrv\NetClient\IVSEventClient.cs
....... 30675 2017-05-05 10:10 YW.VideoSrv\NetClient\LogClient.cs
....... 6909 2017-06-19 12:35 YW.VideoSrv\NetClient\NetClient.csproj
....... 450 2017-05-05 10:10 YW.VideoSrv\NetClient\NETClientExcetion.cs
....... 6244 2017-06-16 16:51 YW.VideoSrv\NetClient\obj\x64\Debug\DesignTimeResolveAssemblyReferencesInput.cache
....... 1396 2017-06-16 15:31 YW.VideoSrv\NetClient\obj\x64\Debug\NetClient.csproj.FileListAbsolute.txt
....... 5364 2017-06-16 16:49 YW.VideoSrv\NetClient\obj\x64\Debug\NetClient.csprojResolveAssemblyReference.cache
....... 68096 2017-06-16 16:49 YW.VideoSrv\NetClient\obj\x64\Debug\NetClient.dll
....... 136704 2017-06-16 16:49 YW.VideoSrv\NetClient\obj\x64\Debug\NetClient.pdb
文件 5930 2017-09-28 10:16 YW.VideoSrv\NetClient\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 3238 2017-09-11 09:26 YW.VideoSrv\NetClient\obj\x86\Debug\NetClient.csproj.FileListAbsolute.txt
文件 5160 2017-09-26 10:48 YW.VideoSrv\NetClient\obj\x86\Debug\NetClient.csprojResolveAssemblyReference.cache
............此处省略456个文件信息
评论
共有 条评论