c# - 当我尝试从 Zxing 库中保存 QR 码时,BarcodeWriter 类出现错误
问题描述
目前我想将我生成的二维码作为图像存储在执行它的电话库中,然后几乎同时将其作为备份上传到亚马逊 AWS,但是当我尝试将我的二维码写为图像时出现错误。
代码:
private void WriteBarcode()
{
ZXing.BarcodeWriter barcodeWriter = new ZXing.BarcodeWriter
{
Format = BarcodeFormat.QR_CODE
};
barcodeWriter
.Write("some string data")
.Save(@"C:\some path");
}
我看到的这段代码应该可以工作,但它标记了 BarcodeWriter 类中的错误,并且我安装了以下依赖项。
Zxing.net
Zxing.Net.Mobile
Zxing.Net.Mobile.Forms
错误
Gravedad Código 描述 Proyecto Archivo Línea Estado suprimido Error CS0305 El uso de tipo de tipo genérico 'BarcodeWriter'
用途:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Xamanimation;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using ZXing.Net.Mobile.Forms;
using ZXing.Mobile;
当我把 ZXing.Mobile.BarcodeWriter
它给我一个错误并说它找不到那个命名空间
解决方案
推荐阅读
- firebase - Flutter 谷歌服务插件
- .net-core - 如何在 .net 2.1 鳕鱼库中使用 log4net
- python - 如何解释 for 循环中给出的多个变量和列表?
- reactjs - 每次全局变化时如何在不渲染的情况下访问上下文状态的一部分?
- c# - 强制 MVC RouteConfig 执行?
- sql - 寻找一种用声明变量替换查询中的表名的方法
- javascript - Knockout JS 将视图模型绑定到多个分布式元素 ID
- excel - 如何只复制尚未复制到其他工作簿的数据行?
- angular - 在 AgGrid 中复制粘贴对象不起作用
- kubernetes - Airflow kubernetes 执行器:在同一个 pod 上运行 2 个作业