PDA物流快递条码扫描系统
来源:互联网 发布:ubuntu cp指令 编辑:程序博客网 时间:2024/05/02 05:42
PDA物流快递条码扫描系统
快件扫描、拍照上传,电子签名上传
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using handset_dll;
using System.Threading;
using System.Media;//for netcf 3.5
using System.IO;
using System.Runtime.InteropServices;
using deliverSys.Utils;
using PocketSignature;
using System.Reflection;
using System.Text.RegularExpressions;
namespace deliverSys
{
public partial class FrmMain : Form
{
private Scan_Interface scan_demo = new Scan_Interface();
private int Scan_Method = 0;
private volatile bool thread_exit = false;
private string scan_text;
private Gprs_connect gprs_conn = new Gprs_connect();
public FrmSign frmSign;
public FrmCaption frmCaption;
//签名
public string imgPath = "";
public string signPath = "";//签名文件
public FrmMain()
{
InitializeComponent();
}
//拍照
private void butPic_Click(object sender, EventArgs e)
{
frmCaption = new FrmCaption(this);
frmCaption.Show();
this.Hide();
}
//提交
private void butSend_Click(object sender, EventArgs e)
{
string sImgName="", sSignName="";
Globals.Ht.Clear();
if (!imgPath.Equals(""))
{
sImgName = txtDeliver.Text + "-" + DateTime.Now.ToString("yyyyMMddHHmmss")+".jpg";
Globals.Ht.Add(sImgName, imgPath);
}
if (!signPath.Equals(""))
{
sSignName = txtDeliver.Text+"-"+signPath;
Globals.Ht.Add(sSignName, Globals.CaptionPath + signPath);
}
string sSql = "insert into deliverSendingPieces([id],[Barcode],[Staffer],[Description],[picPath],[signPath],[createData],[memo]) "+
" values('" + DateTime.Now.ToString("yyyyMMddHHmmss") + "','" + this.txtBarcode.Text + "','" + txtDeliver.Text+ "',"+
" '" + this.txtDecript.Text + "','" + sImgName + "','" + sSignName + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','')";
Cursor.Current = Cursors.WaitCursor;
bool bReturn = Globals.uploadRecord(sSql, Globals.Ht);
Cursor.Current = Cursors.Default;
if (bReturn)
{
MessageBox.Show("上传成功!");
}
else
MessageBox.Show("上传失败!");
}
//退出
private void butExit_Click(object sender, EventArgs e)
{
if (butScan.Text.Equals("停止"))
{
thread_exit = true;
if (scanthread != null)
{
if (!scanthread.Join(2000))
scanthread.Abort();
}
scan_demo.Scan_Close();
}
gprs_conn.Disconnect();
this.Close();
Application.Exit();
}
//扫描
private delegate void scan_delegate();//代理
private Thread scanthread = null;
private void butScan_Click(object sender, EventArgs e)
{
if (butScan.Text.Equals("停止"))
{
thread_exit = true;
if (!scanthread.Join(2000))
scanthread.Abort();
scan_demo.Scan_Close();
butScan.Text = "扫描";
}
else
{
thread_exit = false;
if (scan_demo.com_open)
return;
scan_demo.Scan_Open();
Scan_Method = 2;
this.butScan.Text = "停止";
scanthread = new Thread(new ThreadStart(scan_todo));
scanthread.Start();
}
}
private void scan_display()
{
this.txtBarcode.Text = scan_text;
}
private void scan_todo()
{
scan_delegate fc = new scan_delegate(scan_display);
byte[] temp = new byte[0xff];
temp[0] = 0x00;
scan_demo.Scan_Write(ref temp, 1);
Thread.Sleep(100);
temp[0] = 0x07;
temp[1] = 0xc6;
temp[2] = 0x04;
temp[3] = 0x00;
temp[4] = 0x00;
temp[5] = 0x8a;
temp[6] = 0x04;
temp[7] = 0xfe;
temp[8] = 0xa1;
scan_demo.Scan_Write(ref temp, 9);
//Thread.Sleep(10);
//for(int i=0;i<10;i++)
// scan_text = scan_demo.Scan_Read();
scan_text = "";
while (true)
{
Thread.Sleep(10);
scan_text = scan_demo.Scan_Read();
if (scan_text.Length > 5)
{
this.Invoke(fc);
break;
}
if (thread_exit)
break;
}
scan_demo.Scan_Close();
}
private void FrmMain_Load(object sender, EventArgs e)
{
try
{
thread_exit = true;
if (scanthread != null)
{
if (!scanthread.Join(2000))
scanthread.Abort();
}
scan_demo.Scan_Close();
//gprs连接
gprs_conn.Connect();
}
catch (Exception ex)
{
Globals.WriteLog("启动出错:" + ex.ToString());
}
}
//签名
private void button1_Click(object sender, EventArgs e)
{
frmSign = new FrmSign(this);
frmSign.Show();
this.Hide();
}
}
}
原创文章,禁止做为商用,版权为浩瀚技术团队,转载请注明出处:http://blog.csdn.net/haohantech
- PDA物流快递条码扫描系统
- wince系统PDA 条码扫描 设计
- 快递巴枪,快递物流扫描枪,快递手持终端
- iOS7+系统自带条码扫描
- NiceTrack.cn快递物流跟踪系统接口说明(JAVA版本)
- SAP系统直接查询物流、快递跟踪信息
- 物流链 WMS仓库条码管理系统提高效率
- WMS与PDA扫描业务的结合实现物流仓储管理
- 条码扫描
- 快递物流助手
- 快递物流查询
- 快递物流时间轴
- 快递物流配货发货系统学习--以京东物流为例
- [安卓开发]快递查询demo|Json解析|条形码扫描|物流布局|历史记录
- 思讯服装之星V8盘点机条码数据采集器无线条码扫描枪智能终端PDA-汉码盘点机无缝对接
- 淘宝商家客户管理系统发布啦, 支持条码扫描
- 快递物流第三方接口
- 物流和快递的区别
- yum-utils
- Hibernate的FlushMode
- vnc的encryption文本选择框怎么是灰色的always off ?
- 使用ContentProvider共享数据
- 新的个人所得税 excel算法
- PDA物流快递条码扫描系统
- Classification Probability Models and Conditional Random Fields(1)--Naive Bayes
- Windows 7下DebugView的设置
- 物联网与有源电子标签
- 注册表修改鼠标右键菜单
- Java中的序列化
- gentoo安装实践-scim配置
- 在android上发起异步http请求的最简单方法
- Java中的关键字