Yyt.Abp.HkSdk
1.0.1
dotnet add package Yyt.Abp.HkSdk --version 1.0.1
NuGet\Install-Package Yyt.Abp.HkSdk -Version 1.0.1
<PackageReference Include="Yyt.Abp.HkSdk" Version="1.0.1" />
<PackageVersion Include="Yyt.Abp.HkSdk" Version="1.0.1" />
<PackageReference Include="Yyt.Abp.HkSdk" />
paket add Yyt.Abp.HkSdk --version 1.0.1
#r "nuget: Yyt.Abp.HkSdk, 1.0.1"
#:package Yyt.Abp.HkSdk@1.0.1
#addin nuget:?package=Yyt.Abp.HkSdk&version=1.0.1
#tool nuget:?package=Yyt.Abp.HkSdk&version=1.0.1
Yyt.Abp.HkSdk
English Version
Overview
Yyt.Abp.HkSdk is a library that simplifies the complex protocol integration of .NET applications with the Hikvision Device Network SDK. Built with a modular architecture, it enables seamless integration into your existing projects. Maintained and supported by Patrick.Z, it streamlines routine development configurations in .NET applications and takes over heavy, tedious workloads for you.
Why Choose Yyt.Abp.HkSdk?
- Minimal Dependencies: Lightweight design with few external dependencies, keeps your project lean and efficient.
- Secure by Design: Security is prioritized from the design phase to reduce potential vulnerabilities.
- Highly Extensible: Easy to extend and customize to meet your specific business requirements.
- Battle-Tested: Proven stable and reliable through validation in multiple production projects.
Core Features
By integrating HKSDK for device function calls, it meets different business application needs. Compatible with Win32, Win64, Linux32, and Linux64 platforms.
Main Features:
- Real-time Video Preview: Monitor device real-time video preview
- Video Playback and Download: Playback and download recorded video files
- PTZ Control: Pan-Tilt-Zoom control for cameras
- Log Management: Device log management
- Remote Upgrade: Remote firmware upgrade for devices
- Remote Restart/Shutdown: Remote restart or shutdown of devices
- Format Hard Drive: Format device hard drive
- Parameter Configuration: System configuration, channel configuration, serial port configuration, alarm configuration, user configuration
- Device Capability Set: Retrieve device capability information
Important Notes
**Platform & Network Requirements:** This library does not support ARM architecture platforms. The program and the monitoring device must be on the same network segment.
**Dependency Configuration:** MSBuild enables only direct dependencies by default. For transitive references, version 1.0.0 requires manually updating the
.csprojfile to enable transitive dependencies. This has been fixed in version 1.0.1.<PackageReference Include="Yyt.Abp.HkSdk" Version="1.0.0"> <PrivateAssets>none</PrivateAssets> <IncludeAssets>all</IncludeAssets> </PackageReference>
Code Integration Example
namespace Demo.HttpApi.Host
{
[DependsOn(
typeof(HKSdkModule)
)]
public class DemoHttpApiHostModule : AbpModule
{
// config service & other
}
}
Code Usage Example
// Query video file list
public async Task<ServiceResult<List<FileInfo>>> GetAsync(GetInput input)
{
var registUserId = HKSdkBridge.LoginV30(new LoginV30Input()
{
DvrIP = "10.0.0.1",
DvrPort = 80,
UserName = "**",
Password = "**",
});
var videoRetrievaList = HKSdkBridge.GetVideoRetrieva(new GetVideoInput()
{
DeviceIp = "10.0.0.1",
DevUserId = registUserId,
ChannelNum = 1,
BeginTime = startDate,
EndTime = endDate,
});
var fileList = new List<FileInfo>();
foreach (var item in videoRetrievaList)
{
var file = new FileInfo();
file.BeginTime = item.BeginTime;
file.EndTime = item.EndTime;
file.FileName = item.FileName;
file.FileSize = Convert.ToInt32(item.FileSize);
fileList.Add(file);
}
result.IsSuccess(fileList);
return result;
}
Configuration Example
appsettings.json:
{
"HKSdk": {
"WindowsDriverName": "D",//Video Storage Path / Recording File Directory
"LinuxDirectory": "/data/hksdk",//Video Storage Path / Recording File Directory
"IsLogDebug": false,
"DeleteFileIsRun": false,//Automatic File Cleanup on Schedule / Timed File Removal
"DeleteFilePeriodHour": 24
}
}
Chinese Version
概述
Yyt.Abp.HkSdk 提供了简化 .Net 程序对接海康设备网络 SDK 复杂协议功能。代码采用了 Module 模块化设计,能无缝集成到项目中。该库由 Patrick.Z 提供支持,简化了 .Net 应用程序中的日常开发配置工作,为您分担繁重的工作。
为什么选择 Yyt.Abp.HkSdk?
- 极少依赖:轻量级设计,外部依赖少,保持项目精简高效
- 设计安全:从设计阶段就优先考虑安全性,减少潜在漏洞
- 可扩展定制:易于扩展和定制,满足特定业务需求
- 久经沙场:经过多个生产项目验证,稳定可靠
核心功能
通过集成 HKSDK 进行设备功能调用,满足不同的业务应用需求。兼容 Win32、Win64、Linux32、Linux64 平台。
主要功能包括:
- 实时视频预览:监控设备实时视频预览
- 录像文件回放和下载:回放和下载录像文件
- 云台控制:摄像头云台控制
- 日志管理:设备日志管理
- 远程升级:远程固件升级
- 远程重启/关闭:远程重启或关闭设备
- 格式化硬盘:格式化设备硬盘
- 参数配置:系统配置、通道配置、串口配置、报警配置、用户配置
- 获取设备能力集:获取设备能力信息`
重要说明
**平台与网络要求:** 本库不支持 ARM 架构平台,程序和监控设备必须在同一网段。
**依赖配置:** 由于MSBuid默认启用直接依赖,所以如果类库存在传递引用时,1.0.0版本需要修改直接引用类库的csproj文件手动启用传递依赖,1.0.1版本已解决此问题。
<PackageReference Include="Yyt.Abp.HkSdk" Version="1.0.0"> <PrivateAssets>none</PrivateAssets> <IncludeAssets>all</IncludeAssets> </PackageReference>
代码模块集成示例
namespace Demo.HttpApi.Host
{
[DependsOn(
typeof(HKSdkModule)
)]
public class DemoHttpApiHostModule : AbpModule
{
// config service & other
}
}
代码调用示例
// 查询录像文件列表
public async Task<ServiceResult<List<FileInfo>>> GetAsync(GetInput input)
{
var registUserId = HKSdkBridge.LoginV30(new LoginV30Input()
{
DvrIP = "10.0.0.1",
DvrPort = 80,
UserName = "**",
Password = "**",
});
var videoRetrievaList = HKSdkBridge.GetVideoRetrieva(new GetVideoInput()
{
DeviceIp = "10.0.0.1",
DevUserId = registUserId,
ChannelNum = 1,
BeginTime = startDate,
EndTime = endDate,
});
var fileList = new List<FileInfo>();
foreach (var item in videoRetrievaList)
{
var file = new FileInfo();
file.BeginTime = item.BeginTime;
file.EndTime = item.EndTime;
file.FileName = item.FileName;
file.FileSize = Convert.ToInt32(item.FileSize);
fileList.Add(file);
}
result.IsSuccess(fileList);
return result;
}
配置示例
appsettings.json:
{
"HKSdk": {
"WindowsDriverName": "D",//录像文件保存目录
"LinuxDirectory": "/data/hksdk",//录像文件保存目录
"IsLogDebug": false,
"DeleteFileIsRun": false,//定时删除是否启动
"DeleteFilePeriodHour": 24
}
}
Document Version: v1.0
Created Date: July 2026
Author: Patrick.Z
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Volo.Abp.AspNetCore (>= 6.0.2)
- Volo.Abp.BackgroundWorkers (>= 6.0.2)
- Volo.Abp.Core (>= 6.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Yyt.Abp.HkSdk:
| Package | Downloads |
|---|---|
|
Yyt.Abp.HkSdk.Grpc.Server
it is a library that provides the functionality to encapsulate the Hikvision SDK (hksdk) protocol as a gRPC server service for .NET applications. Built with a modular architecture, it enables seamless integration into your existing projects.Maintained and supported by Patrick.Z, it streamlines routine development configurations in .NET applications and takes over heavy, tedious workloads for you. |
GitHub repositories
This package is not used by any popular GitHub repositories.