QuickNV.HikvisionNetSDK.Api
1.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package QuickNV.HikvisionNetSDK.Api --version 1.0.2
NuGet\Install-Package QuickNV.HikvisionNetSDK.Api -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QuickNV.HikvisionNetSDK.Api" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QuickNV.HikvisionNetSDK.Api --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: QuickNV.HikvisionNetSDK.Api, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install QuickNV.HikvisionNetSDK.Api as a Cake Addin #addin nuget:?package=QuickNV.HikvisionNetSDK.Api&version=1.0.2 // Install QuickNV.HikvisionNetSDK.Api as a Cake Tool #tool nuget:?package=QuickNV.HikvisionNetSDK.Api&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
QuickNV.HikvisionNetSDK.Api
Avaliable as nuget
Api for Hikvision NetSDK.
示例
using QuickNV.HikvisionNetSDK.Api;
using Newtonsoft.Json;
using System.Text;
var host = "127.0.0.1";
var port = 8000;
var user = "admin";
var password = "123456";
var encoding = CodePagesEncodingProvider.Instance.GetEncoding("gb2312");
try
{
HvSession.Init();
Console.WriteLine("初始化成功!");
//登录
Console.WriteLine("正在登录...");
var session = HvSession.Login(host, port, user, password, encoding);
Console.WriteLine("登录成功!");
Console.WriteLine("设备时间: " + session.ConfigService.GetTime());
Console.WriteLine("设备配置: " + JsonConvert.SerializeObject(session.ConfigService.GetDeviceConfig(), Formatting.Indented));
Console.WriteLine("网络配置: " + JsonConvert.SerializeObject(session.ConfigService.GetNetworkConfig(), Formatting.Indented));
Console.WriteLine("硬盘配置: " + JsonConvert.SerializeObject(session.ConfigService.GetHdConfig(), Formatting.Indented));
Console.WriteLine("正在读取通道名称...");
session.ChannelService.RefreshChannelsName();
Console.WriteLine("模拟通道:" + string.Join(",", session.ChannelService.AnalogChannels.Select(t => $"通道{t.Id}_{t.Name}")));
Console.WriteLine("IP通道:" + string.Join(",", session.ChannelService.IpChannels.Select(t => $"通道{t.Id}_{t.Name}")));
//如果存在IP通道
if (session.ChannelService.IpChannels.Count > 0)
{
Console.WriteLine("开始下载...");
var channel = session.ChannelService.IpChannels.First();
var stopTime = DateTime.Now;
var startTime = stopTime.AddMinutes(-1);
var localFileName = $"{channel.Name}_{startTime.ToString("yyyyMMddHHmmss")}_{stopTime.ToString("yyyyMMddHHmmss")}.mp4";
var fileHandle = session.VideoFileService.StartDownloadFile(channel.Id, startTime, stopTime, localFileName);
while (true)
{
Thread.Sleep(1000);
var progress = session.VideoFileService.GetDownloadPosition(fileHandle);
if (progress < 0 || progress > 100)
throw new Exception("Download error.Progress: " + progress);
Console.CursorLeft = 0;
Console.Write($"进度:{progress}%");
if (progress == 100)
break;
}
Console.WriteLine();
session.VideoFileService.StopDownloadFile(fileHandle);
Console.WriteLine("下载完成。文件:" + localFileName);
}
//退出登录
session.Logout();
Console.WriteLine("退出登录完成");
//清理
HvSession.Cleanup();
Console.WriteLine("清理完成");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- QuickNV.HikvisionNetSDK (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.