我有ZKTeco Biometrics设备,它使用本教程(C#ZKTeco生物识别设备入门)与C#windows应用程序连接.
它工作正常,但一段时间后,我的应用程序无法ping通设备.如下面的代码建议,我试图在每25秒后ping一次设备.
private void TimerCheckPingAndCloseAttendanceForm() {
timerCheckPingAndCloseAttendanceForm = new Timer();
timerCheckPingAndCloseAttendanceForm.Tick += new EventHandler(CheckPingAndCloseAttendanceForm);
timerCheckPingAndCloseAttendanceForm.Interval = 25000;//25 seconds.
timerCheckPingAndCloseAttendanceForm.Start();
}
private void CheckPingAndCloseAttendanceForm(object sender, EventArgs e) {
string ipAddress = tbxDeviceIP.Text.Trim();
if (UniversalStatic.PingTheDevice(ipAddress) == false) {
//CloseAttendaceListForm();
IsDeviceConnected = false;
string infoString = "Application started on " + applicationStartDateTime.ToString() + " and ping failed on " + DateTime.Now.ToString() + " then, app closed while device ip is "+ ipAddress;
File.AppendAllText("ConnectionLog.txt", infoString + Environment.NewLine);
Application.Exit();
//timerCheckPingAndCloseAttendanceForm.Tick -= …Run Code Online (Sandbox Code Playgroud) 我试图在PC(OS Win7,64位)上运行Windows应用程序(winForm),但它显示了此错误或异常:
由于以下错误,无法为具有CLSID {00853A19-BD51-419B-9269-2DABE57EB61f}的组件检索COM类工厂:80040154未注册类(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG))。
我谷歌搜索,发现我应该需要为x86构建(虽然当前窗口是64位)。我这样做了,但是得到了同样的错误。在那之后,我现在尝试安装zkeeper依赖项,但出现此错误:
模块D:\ TheSDK \ zkemkeeper.dll“可能与您正在运行的Windows版本不兼容。请检查该模块是否与regsvr32.exe的x86或x64版本兼容。
这是批处理文件(Dependency SDK安装程序):
cd /d %~dp0
if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (
echo system is x86
copy .\*.dll %windir%\system32\
regsvr32 %windir%\system32\zkemkeeper.dll
) else (
echo system is x64
copy .\*.dll %windir%\SysWOW64\
regsvr32 %windir%\SysWOW64\zkemkeeper.dll
)
Run Code Online (Sandbox Code Playgroud)
更新:即使我尝试手动运行和安装regsvrsystem32和64,仍然出现相同的错误。
我正在从事一个目前已经建成并投入运行的项目。但是当我尝试将指纹从设备插入数据库表时出现问题。让我写一下它之前运行良好。但是当我设置新计算机或将项目移动到新环境中时,它会抛出异常:
由于以下错误,检索 CLSID 为 {00853A19-BD51-419B-9269-2DABE57EB61F} 的组件的 COM 类工厂失败:80040154 类未注册(HRESULT 异常:0x80040154 (REGDB_E_CLASSNOTREG))。
这是一个使用ZkemKeeper的指纹考勤系统,dll文件随项目一起附上。这是代码片段:
/**This is a list of the users from database that uses fingerprint system - Starts**/
List<AttMachineBO> lstfrom = new List<AttMachineBO>();
for (int i = 0; i < dgv_Machine.Rows.Count; i++)
{
if (dgv_Machine.Rows[i].Cells[0].Value == null)
{
dgv_Machine.Rows[i].Cells[0].Value = false;
}
if ((bool)dgv_Machine.Rows[i].Cells[0].Value == true)
{
AttMachineBO obj = new AttMachineBO();
obj.Mechine_No = dgv_Machine.Rows[i].Cells[1].Value.ToString();
obj.Machine_Name = dgv_Machine.Rows[i].Cells[2].Value.ToString();
obj.IP_Address = dgv_Machine.Rows[i].Cells[3].Value.ToString().Trim();
lstfrom.Add(obj);
}
}
/**This is a list of the users …Run Code Online (Sandbox Code Playgroud) c# ×3
zkemkeeper ×3
biometrics ×1
com ×1
connection ×1
device ×1
dll ×1
exception ×1
winforms ×1
zkteco ×1