Denso BHT-200QW Especificaciones Pagina 132

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 377
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 131
- 130 -
When CD type is I (ITF):
The
barcode data must be an even number with two or more digits. Otherwise, this function
returns "0" and throws an exception.
To check whether the CD is correct, pass a piece of barcode data with a CD to the
Scanner.GetChkDigit method as shown below. If the returned value is equal to the CD,
then the CD is correct.
[VB]
If (Scanner.GetChkDigit("123457", "I") = Asc("7")) Then
Console.WriteLine ("CD OK")
End If
[C#]
UnicodeEncoding encode = new UnicodeEncoding();
if (Scanner.GetChkDigit("123457", 'I') == (int)encode.GetBytes("7")[0]) {
Console.WriteLine ("CD OK");
}
To append a CD to barcode data, pass a piece of barcode data with a dummy character
appended to the Scanner.GetChkDigit method as shown below. The returned value will be
the CD. Replace the dummy character with the returned value.
[VB]
Dim origData As String = "12345"
Dim digit As Integer = Scanner.GetChkDigit(origData+"0", "I")
Console.WriteLine("CD = {0}", origData + New String(Chr(digit), 1))
[C#]
string origData = "12345";
int digit = Scanner.GetChkDigit(origData+"0", 'I');
byte[] digitByteArray = {(byte)digit};
ASCIIEncoding encode = new ASCIIEncoding();
Console.WriteLine("CD = {0}", origData + encode.GetString(digitByteArray, 0, 1));
Result
> CD = 123457
Vista de pagina 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 376 377

Comentarios a estos manuales

Sin comentarios