private void bbiMiText_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { string fPath; if (sfdText.ShowDialog() != DialogResult.OK) { return; } fPath = sfdText.FileName; if (string.IsNullOrEmpty(fPath)) { return; } var miDt = GetPrintTable(); TextWriter tw = new StreamWriter(fPath, true); if (miDt.Rows.Count < 1) { return; } for (var i = 0; i < miDt.Rows.Count; i++) { var cSerial = String.Format(@"I*{0}*C*{1}*L*{2}", miDt.Rows[i]["cInvCode"], miDt.Rows[i]["cSerialNumber"], miDt.Rows[i]["cLotNo"]); tw.WriteLine("{0} {1}", cSerial, miDt.Rows[i]["cSerialNumber"]); } tw.Close(); DllWmsMain.RecordPrintLog(_cGuid); MessageBox.Show(@"导出成功"); }