资源简介
VS2010开发,调用zxing和Vintasoft.Barcode识别文件夹中条码
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Vintasoft.Barcode;
using Vintasoft.Barcode.BarcodeInfo;
using System.IO;
namespace BarCodeFind
{
public partial class Form1 : Form
{
//二维码
BarcodeReader _reader = new BarcodeReader();
public Form1()
{
InitializeComponent();
folderBrowserDialog1.SelectedPath = Application.ExecutablePath;
}
private void button1_Click(object sender EventArgs e)
{
string fnamestr = ““;
try
{
if (textBox1.Text != ““)
{
string filepath = textBox1.Text;
label3.Text = filepath;
DirectoryInfo D = new DirectoryInfo(filepath);//图片目录
FileInfo[] F = D.GetFiles();
progressBar1.Maximum = F.Length;
progressBar1.Value = 0;
int changesucces = 0;
for (int i = 0; i < F.Length; i++)
{
progressBar1.Value = i;
try
{
Bitmap b = new Bitmap(F[i].FullName);
label2.Text = F[i].Name;
string ext = Path.GetExtension(F[i].FullName).ToLower();
label4.Text = ext;
// If the image is upsidedown
b.RotateFlip(RotateFlipType.RotateNoneFlipY);
Image _image = b;
if (_image != null)
{
InitReaderSettings();
IBarcodeInfo[] infos;
try
{
infos = _reader.ReadBarcodes(_image);
if (infos.Length > 0)
{
if (infos[0].Value.Length >= 10)
{
changesucces++;
if (fnamestr.IndexOf(infos[0].Value) > 0)
{
F[i].MoveTo(filepath + @“\“ + infos[0].Value + “(“ + i.ToString() + “)“ + ext);
}
else
{
try
{
F[i].MoveTo(filepath + @“\“ + infos[0].Value + ext
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 144 2014-07-20 15:09 BarCodeFind\BarCodeFind\app.config
文件 5846 2014-07-21 00:12 BarCodeFind\BarCodeFind\BarCodeFind.csproj
文件 227 2014-07-20 04:15 BarCodeFind\BarCodeFind\BarCodeFind.csproj.user
文件 47104 2014-11-02 14:57 BarCodeFind\BarCodeFind\bin\Debug\BarCodeFind.exe
文件 144 2014-07-20 15:09 BarCodeFind\BarCodeFind\bin\Debug\BarCodeFind.exe.config
文件 46592 2014-11-02 14:57 BarCodeFind\BarCodeFind\bin\Debug\BarCodeFind.pdb
文件 11600 2014-11-01 23:14 BarCodeFind\BarCodeFind\bin\Debug\BarCodeFind.vshost.exe
文件 144 2014-07-20 15:09 BarCodeFind\BarCodeFind\bin\Debug\BarCodeFind.vshost.exe.config
文件 490 2010-03-17 22:39 BarCodeFind\BarCodeFind\bin\Debug\BarCodeFind.vshost.exe.manifest
文件 81 2014-11-03 18:35 BarCodeFind\BarCodeFind\bin\Debug\ClienConnect.ini
文件 169560 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\de\DevExpress.Data.v12.1.resources.dll
文件 11352 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\de\DevExpress.Printing.v12.1.Core.resources.dll
文件 34392 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\de\DevExpress.Utils.v12.1.resources.dll
文件 54872 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\de\DevExpress.XtraEditors.v12.1.resources.dll
文件 46680 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\de\DevExpress.XtraGrid.v12.1.resources.dll
文件 16472 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\de\DevExpress.XtraLayout.v12.1.resources.dll
文件 2958848 2012-09-11 20:01 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.Data.v12.1.dll
文件 882069 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.Data.v12.1.xm
文件 2129496 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.Printing.v12.1.Core.dll
文件 669345 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.Printing.v12.1.Core.xm
文件 3685888 2012-09-11 20:03 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.Utils.v12.1.dll
文件 419641 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.Utils.v12.1.xm
文件 2308696 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.XtraEditors.v12.1.dll
文件 1307842 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.XtraEditors.v12.1.xm
文件 2225752 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.XtraGrid.v12.1.dll
文件 1290443 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.XtraGrid.v12.1.xm
文件 754264 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.XtraLayout.v12.1.dll
文件 311754 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\DevExpress.XtraLayout.v12.1.xm
文件 173656 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\es\DevExpress.Data.v12.1.resources.dll
文件 12888 2013-05-20 22:34 BarCodeFind\BarCodeFind\bin\Debug\es\DevExpress.Printing.v12.1.Core.resources.dll
............此处省略67个文件信息
- 上一篇:泛函分析讲义复旦大学.pdf
- 下一篇:基于PCA的人脸识别系统
评论
共有 条评论