※ライブラリは以下参照
QR Code Encoder and Decoder .NET Class Library
https://www.codeproject.com/Articles/1250071/QR-Code-Encoder-and-Decoder-NET-Class-Library-Writ
QRCodeEncoderDecoderLibrary.dll
QRCodeEncoderDecoderLibrary.dll
QRコードを、SJISとUTF8で出しわける
以下、
> qr_encode_sjis_and_utf8.exe abcあいdef
で実行したケース
qr_encode_sjis_and_utf8.cs
//c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /reference:QRCodeEncoderDecoderLibrary.dll /target:winexe qr_encode_sjis_and_utf8.csusingSystem;usingSystem.Windows.Forms;usingSystem.Drawing;usingQRCodeEncoderDecoderLibrary;publicclassqr_encode_sjis_and_utf8{publicstaticvoidMain(string[]args){stringstr;str=@""+args[0];QREncoderQRCodeEncoder;BitmapQRCodeImage;QRCodeEncoder=newQREncoder();byte[]bytesDataU=System.Text.Encoding.UTF8.GetBytes(str);byte[]bytesDataJ=System.Text.Encoding.GetEncoding(932).GetBytes(str);QRCodeEncoder.Encode(ErrorCorrection.H,bytesDataU);QRCodeImage=QRCodeToBitmap.CreateBitmap(QRCodeEncoder,4,8);QRCodeImage.Save(@".\\QR_UTF8.png",System.Drawing.Imaging.ImageFormat.Png);QRCodeEncoder.Encode(ErrorCorrection.H,bytesDataJ);QRCodeImage=QRCodeToBitmap.CreateBitmap(QRCodeEncoder,4,8);QRCodeImage.Save(@".\\QR_SJIS.png",System.Drawing.Imaging.ImageFormat.Png);}}