diff --git a/SlnMesnac.TouchSocket/ApiServer.cs b/SlnMesnac.TouchSocket/ApiServer.cs index 9235584..e92e074 100644 --- a/SlnMesnac.TouchSocket/ApiServer.cs +++ b/SlnMesnac.TouchSocket/ApiServer.cs @@ -96,7 +96,7 @@ namespace SlnMesnac.TouchSocket if(result != "多条码" && result != "noread" && result != "NoRead" && !string.IsNullOrEmpty(result)) { - isOk = "Ok"; + isOk = "OK"; }else if(result == "多条码") { isOk = "Mul"; @@ -257,10 +257,23 @@ namespace SlnMesnac.TouchSocket { if(rfidStr != "noread") { - string bufferHex = rfidStr.Substring(bufferStart.Length, bufferBody.Length); + int hexLength = Convert.ToInt32(rfidStr.Substring(4, 2)); + + string bufferHex = rfidStr.Substring(bufferStart.Length, hexLength * 2); long decimalValue = Convert.ToInt64(bufferHex, 16); + //if (rfidStr.Contains("0C2")) + //{ + // rfidStr = decimalValue.ToString().PadLeft(10, '0'); + //} + //else + //{ + // rfidStr = decimalValue.ToString(); + //} + rfidStr = decimalValue.ToString(); + + } }