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?

有帮助吗?

解决方案

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
   ...
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top