public static int Login(string IP, ushort Port, string Name, string Password, int time = 1) { int UserID = 0; if (SystemHelper.GetOSBit() == OSBit.OS64Bit) { for (int i = 0; i <= time; i++) { UserID = HCNetSDK_X64.NET_DVR_Login_V30(IP, Port, Name, Password, out lpDeviceInfo_X64); if (UserID != -1) { break; } } } else { for (int i = 0; i <= time; i++) { UserID = HCNetSDK_X86.NET_DVR_Login(IP, Port, Name, Password, out lpDeviceInfo); if (UserID != -1) { break; } } } return(UserID); }
public static int Login(string IP, ushort Port, string Name, string Password, int time = 1) { int UserID = 0; for (int i = 0; i <= time; i++) { UserID = HCNetSDK_X64.NET_DVR_Login_V30(IP, Port, Name, Password, ref lpDeviceInfo_X64); if (UserID != -1) { break; } } return(UserID); }