using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AccessBusiness.Common;
using System.Runtime.InteropServices;
namespace AccessBusiness
{
public class HIV
{
/// <summary>
/// 初始化门禁SDK
/// </summary>
/// <returns>true:成功 false:失败</returns>
public static bool InitialSDK()
{
// 初始化SDK
bool bInit = CHCNetSDK.NET_DVR_Init();
if (!bInit)
{
// 初始化失败
CMMLog.Error("海康门禁SDK初始化失败 !");
}
else
{
CMMLog.Info("海康门禁SDK初始化成功!");
}
return bInit;
}
/// <summary>
/// 实例化对象
/// </summary>
/// <param name="sLoginName">登陆名</param>
/// <param name="sPwd">密码</param>
/// <param name="sIP">IP</param>
/// <param name="sPort">端口号</param>
public HIV(string sLoginName, string sPwd, string sIP, ushort uPort)
{
this.LoginName = sLoginName;
this.Pwd = sPwd;
this.IP = sIP;
this.Port = uPort;
}
#region 属性
/// <summary>
/// 登陆名
/// </summary>
public string LoginName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Pwd { get; set; }
/// <summary>
/// IP
/// </summary>
public string IP { get; set; }
/// <summary>
/// 端口号
/// </summary>
public ushort Port { get; set; }
/// <summary>
/// 门序号
/// </summary>
public int GateWayIndex { get; set; }
private uint _OperationType = 5;
/// <summary>
/// 0- 关闭,1- 打开,2- 常开,3- 常关,4- 授权,5- 清除权限
/// </summary>
public uint OperationType
{
get { return this._OperationType; }
set { this._OperationType = value; }
}
/// <summary>
/// 用户登陆后的ID
/// </summary>
private int LoginUserID;
#endregion
/// <summary>
/// 门操作
/// </summary>
/// <param name="uType">0- 关闭,1- 打开,2- 常开,3- 常
海康门禁C# demo-开,关,常开,常关,授权,清权
最新推荐文章于 2024-06-16 10:36:46 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)