private void ProcessDeviceCDM1Command(IWebSocketConnection connection, CmdUnit unit) { try { CDM1Unit d10 = (CDM1Unit)unit; CDM1Unit ret = null; CDM1Device device = new CDM1Device(); device.delegateSendErrorInfo = new ECardDevice.SendErrorInfoDelegate(ShowCustInfoPro); device.delegateSendReportInfo = new ECardDevice.SendReportInfoDelegate(ShowCustInfoPro); ret = device.SendCommand(unit); string retBuffer = System.Text.Encoding.UTF8.GetString(ret.LoadData()); // connection.sendData(retBuffer); connection.Send(retBuffer); } catch { throw; } }
private void ProcessData(string cmd) { try { CDM1Unit unit = (CDM1Unit)ECardDevice.CreateDeviceUnit(cmd); CDM1Device device = new CDM1Device(); CDM1Unit ret = device.SendCommand(unit); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }