Code Hcnetsdkdll 23 Verified: Hikvision Error

You changed the camera or NVR’s admin password but forgot to update it in iVMS-4200. The software caches the old password and fails verification.

Some developers mistakenly attribute error 23 to network problems. The following errors have different codes:

| Issue | Actual HCNETSDK Error Code | |-------|----------------------------| | Device unreachable | 7 (NET_DVR_NETWORK_ERROR) | | Wrong port | 11 (NET_DVR_NETERROR_CONNECTFAIL) | | SDK version mismatch | 1 (NET_DVR_NOERROR but login returns 0) | | Insufficient user permissions | 25 (NET_DVR_NOOPERATIONRIGHT) | hikvision error code hcnetsdkdll 23 verified


If you are using Hikvision software to connect a non-Hikvision ONVIF camera, the ONVIF user must have "Operator" or "Administrator" privileges. A "Viewer" level ONVIF user will trigger Error 23.


#include "HCNetSDK.h"
#include <iostream>

int main() NET_DVR_Init(); NET_DVR_SetConnectTime(2000, 1); You changed the camera or NVR’s admin password

NET_DVR_USER_LOGIN_INFO loginInfo = 0;
NET_DVR_DEVICEINFO_V40 devInfo = 0;
strcpy(loginInfo.sDeviceAddress, "192.168.1.100");
loginInfo.wPort = 8000;
strcpy(loginInfo.sUserName, "admin");
strcpy(loginInfo.sPassword, "your_password");
loginInfo.bUseAsynLogin = 0; // synchronous
LONG userID = NET_DVR_Login_V40(&loginInfo, &devInfo);
if (userID < 0) 
    DWORD err = NET_DVR_GetLastError();
    if (err == 23) 
        std::cout << "ERROR 23: Invalid username or password. Check credentials and user lockout status." << std::endl;
else 
    std::cout << "Login successful. User ID: " << userID << std::endl;
    NET_DVR_Logout(userID);
NET_DVR_Cleanup();
return 0;


Hikvision devices have two distinct security layers:

If your device has a Verification Code (6-12 uppercase letters/digits) set but iVMS is trying to log in using only the admin password, Error 23 appears. If you are using Hikvision software to connect