public string DownFile = "\\下载.txt";//下载路径 public string LoadFile = "\\上传.txt";//上传路径 public List<string> _readtxt = new List<string>(); public MainForm() { InitializeComponent(); tbDelivery.Focus(); } private void btnDownLoad_Click(object sender, EventArgs e) { try { if (tbDelivery.Text.Trim().Length == 0) { MES.PDA.Core.Service.MessageServices.ShowWarm("请先扫描供货号!"); tbDelivery.Focus(); return; } else { if (!CheckDelivery()) { return; } if (System.IO.File.Exists(DownFile)) { StreamReader objReader = new StreamReader(DownFile); string sLine = ""; sLine = objReader.ReadLine(); if (sLine != string.Empty) { string[] ss = sLine.Split(','); if (ss.Length > 0) { if (ss[0] != tbDelivery.Text.Trim()) { MES.PDA.Core.Service.MessageServices.ShowWarm("本机已下载供货号:" + ss[0] + ",请扫描该供货号并上传后,再下载其他供货号!"); objReader.Close(); return; } else { MES.PDA.Core.Service.MessageServices.ShowWarm("该供货号已下载,请进行扫描并上传!"); objReader.Close(); return; } } } objReader.Close(); } else { FileStream fs = System.IO.File.Create(DownFile); StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.GetEncoding("UTF-8")); string sql = Sql.getDelivery(tbDelivery.Text.Trim()); Daisy.Common.McsClient.McsDataReader reader = (Daisy.Common.McsClient.McsDataReader)MES.PDA.Core.Service.DatabaseAccessService.execute(sql, MES.PDA.Core.Service.ReturnType.RESULTSET); if (reader.rowNumber == 0) { MES.PDA.Core.Service.MessageServices.ShowWarm("获取供货号信息失败!"); sw.Close(); return; } else { string sLine = string.Empty; while (reader.Read()) { //MES.PDA.Core.Service.MessageServices.ShowWarm(reader.getString(2)); sLine = reader.getString(0) + "," + reader.getString(1) + "," + reader.getString(2) + "," + reader.getString(3) + "," + reader.getString(4) + "," + reader.getString(5); //sw.WriteLine(sLine); sw.WriteLine(sLine); } sw.Flush(); sw.Close(); } var sqlload = "{?=call apps.cux_pda_load_scan_utl.init_data_download('" + tbDelivery.Text.Trim() + "')}"; //MES.PDA.Core.Service.MessageServices.ShowWarm(sql); //return; string ret = (string)MES.PDA.Core.Service.DatabaseAccessService.execute(sqlload, ReturnType.STRING); if (!ret.StartsWith("0@")) { MES.PDA.Core.Service.MessageServices.ShowWarm(ret); return; } else { MES.PDA.Core.Service.MessageServices.ShowWarm("下载成功!"); btnScan.Focus(); } } } } catch (Exception ex) { MES.PDA.Core.Service.MessageServices.ShowWarm(ex.ToString()); } }
PDA开发数据由DB下载至PDA本地
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:PDA开发数据由本地上传至DB
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
PDA开发
学习一下
职场 PDA 休闲 PDA开发 -
PDA 进程篇
起因是在PDA上A程序需要更新,激活了B程序,B程序开始下载最新的A程序,但A程序没有完全结束导致出错。需要在B程
string qq 工作 微软 c -
pda连接Android studio pda连接wifi
演示设备:惠普2210 操作系统:Pocket_PC2003 USB 蓝牙适配器(EagleTec) 当蓝牙技术不断地更新,我们生活中的蓝牙设备也越来越多,但是有谁能够完全的发挥它的功效呢?今天给大家介绍一种方法能够让您的pd
pda连接Android studio 工作 internet 浏览器 加密