Domanda

Using ZXING Barcode component if I read this QRCode I get this VCARD:

1: enter image description here

BEGIN:VCARD
VERSION:3.0
N:haluk
ORG:test
TITLE:12345
TEL:55533344121
END:VCARD

I just need the N and ORG values, is it possible to parse it?

È stato utile?

Soluzione

ZXing contains a ResultParser class which does the job for you. Here is an example for ZXing.Net (C#):

// "result" is an instance of the barcode scanning result
var parsedResult = ResultParser.parseResult(result) as AddressBookParsedResult;
if (parsedResult != null)
{
   // N value
   var nValue = parsedResult.Names;
   // ORG value
   var orgValue = parsedResult.Org;
   // do something with the values
   ...
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top