我必須做條形碼掃描。我在Portable Class Library中添加了zxing.net.mobile。但是當調用掃描方法時,我得到下面的錯誤。在PCL中實現zxing.net.mobile
System.NotSupportedException:請改用平臺特定的實現!
和我的代碼如下所示。
public void Scan()
{
MobileBarcodeScanningOptions options = new MobileBarcodeScanningOptions();
options.DelayBetweenContinuousScans = 2000;
options.AutoRotate = false;
var scanner = new MobileBarcodeScanner();
scanner.ScanContinuously(options, HandleScanResult);
}
private void HandleScanResult(ZXing.Result result)
{
string msg;
if (result != null && !string.IsNullOrEmpty(result.Text)) // Success
{
msg = result.Text;
}
else // Canceled
{
msg = "Scanning Canceled!";
}
}
如何解決這個問題。請幫忙。謝謝。