문제

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