QRコードシリーズ
exeをクリックすると同階層以下の、ファイルをなめて、tifファイルをすべて、QR読み込みし、テキストに書き出すツール。
(tifをjpgに変えるなどは適宜やってください)
↓これの続きです
ーーー
画面表示(スクリーンショット)から、QRコードを読み込んで、デコードするC#の単体アプリ⇒テキスト書き出し版
https://qiita.com/santarou6/items/9a26c28828c1dd1a6556
ーーー
tiff_qr_decode.cs
//c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /reference:QRCodeEncoderDecoderLibrary.dll /target:winexe tiff_qr_decode.csusingSystem;usingSystem.Windows.Forms;usingSystem.Drawing;usingQRCodeEncoderDecoderLibrary;publicclasstiff_qr_decode{publicstaticvoidMain(string[]args){QRDecoderQRCodeDecoder;BitmapQRCodeInputImage;QRCodeDecoder=newQRDecoder();DateTimedt=DateTime.Now;stringdt_s=dt.ToString("yyyyMMdd_HHmmss");System.IO.File.WriteAllText(@".\"+dt_s+".txt",dt_s+Environment.NewLine);stringappPath=System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;System.IO.DirectoryInfodi=newSystem.IO.DirectoryInfo(appPath);System.IO.FileInfo[]files=di.GetFiles("*.tif",System.IO.SearchOption.AllDirectories);foreach(System.IO.FileInfofinfiles){System.IO.File.AppendAllText(@".\"+dt_s+".txt",f.FullName);System.IO.File.AppendAllText(@".\"+dt_s+".txt","\t");QRCodeInputImage=newBitmap(f.FullName,true);byte[][]DataByteArray=QRCodeDecoder.ImageDecoder(QRCodeInputImage);//string Result = System.Text.Encoding.GetEncoding(932).GetString(DataByteArray[0]);stringResult=System.Text.Encoding.UTF8.GetString(DataByteArray[0]);//string Result = System.Text.Encoding.GetEncoding(51932).GetString(DataByteArray[0]);//ビジネスロジック //string str1 = Result.Replace("ω", " ");//str1 = str1.Replace("Ω", "\t");System.IO.File.AppendAllText(@".\"+dt_s+".txt",str1);System.IO.File.AppendAllText(@".\"+dt_s+".txt",Environment.NewLine);}}}