我是靠谱客的博主 俊逸煎蛋,这篇文章主要介绍二维码生成与解析 (使用ThoughtWorks.QRCode),现在分享给大家,希望可以做个参考。

  • 二维码生成

QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();

qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; //  support different mode

qrCodeEncoder.QRCodeScale = 1;

qrCodeEncoder.QRCodeVersion = 1.0;

qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.L; // support different mode

string qrCodeContent = "test";

Bitmap img = qrCodeEncoder.Encode(qrCodeContent);

string filePath = "c:\qrcode.png" // support different image format

img.Save(filePath);

  • 二维码解析
QRCodeDecoder decoder = new QRCodeDecoder();
s tring decodedString = decoder.decode(new QRCodeBitmapImage(new Bitmap("c:\qrcode.png"))); // decodedStringshould be "test".

最后

以上就是俊逸煎蛋最近收集整理的关于二维码生成与解析 (使用ThoughtWorks.QRCode)的全部内容,更多相关二维码生成与解析内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部