Hik.Api 1.0.13.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Hik.Api --version 1.0.13.1                
NuGet\Install-Package Hik.Api -Version 1.0.13.1                
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="Hik.Api" Version="1.0.13.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hik.Api --version 1.0.13.1                
#r "nuget: Hik.Api, 1.0.13.1"                
#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 Hik.Api as a Cake Addin
#addin nuget:?package=Hik.Api&version=1.0.13.1

// Install Hik.Api as a Cake Tool
#tool nuget:?package=Hik.Api&version=1.0.13.1                

Hik.Api

  • Simple wrapper over Hikvision SDK, with minimal functionality. Login, fetch files list, download files, and log out.

  • Console app sample

Usage

IHikApi hikApi = new HikApi();
hikApi.Initialize();
hikApi.SetupLogs(3, "C:\\sdkLogsPath", false);
hikApi.SetConnectTime(2000, 1);
hikApi.SetReconnect(10000, 1);

var session = hikApi.Login("192.168.1.64", 8000, "admin", "pass");

//Get photos files for last 2 hours
var photos = await hikApi.PhotoService.FindFilesAsync(DateTime.Now.AddHours(-2), DateTime.Now, session);
foreach (var photo in photos)
{
    hikApi.PhotoService.DownloadFile(session.UserId, photo.Name, photo.Size, "photoFilePath.jpg");
}

//Get video files for last 2 hours
var videos = await hikApi.VideoService.FindFilesAsync(DateTime.Now.AddHours(-2), DateTime.Now, session);

foreach (var video in videos)
{
    var downloadId = hikApi.VideoService.StartDownloadFile(session.UserId, video.Name, "videoFilePath.mp4");
    do
    {
        await Task.Delay(1000);
        int downloadProgress = hikApi.VideoService.GetDownloadPosition(downloadId);
        if (downloadProgress == 100)
        {
            hikApi.VideoService.StopDownloadFile(downloadId);
            break;
        }
        else if (downloadProgress < 0 || downloadProgress > 100)
        {
            throw new InvalidOperationException($"UpdateDownloadProgress failed, progress value = {downloadProgress}");
        }
    }
    while (true);
}

hikApi.Logout(session.UserId);
hikApi.Cleanup();
Product 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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 578 1/11/2024
1.0.14 197 9/19/2023
1.0.13.1 610 6/22/2022
1.0.12 384 12/3/2021

Summary of changes made in this release of the package.