/// <summary> /// 成功取到指纹事件 /// </summary> /// <param name="ActionResult"></param> /// <param name="ATemplate"></param> void zpf_OnCapture(bool ActionResult, object ATemplate) { foreach (WebSocketSession session in webSocketServer.GetAllSessions()) { WebSocketResult result = new WebSocketResult(); result.DeviceID = ID; try { if (ActionResult) { ZKFPEngXClass ztlp = new ZKFPEngXClass(); string sss = ztlp.EncodeTemplate1(ATemplate); result.ResultCode = PsDeviceConstant.RESULT_OK; result.ResultData = sss; result.ErrorMsg = ""; result.Command = ""; } else { result.ResultCode = PsDeviceConstant.RESULT_FAILED; result.ResultData = ""; result.ErrorMsg = PsDeviceConstant.READFP_FAILED; result.Command = ""; } } catch (Exception e) { result.ResultCode = PsDeviceConstant.RESULT_FAILED; result.ResultData = ""; result.ErrorMsg = e.Message; result.Command = ""; } finally { session.Send(result.JsonText); } } }