+ -
当前位置:首页 → 问答吧 → 大侠帮忙

大侠帮忙

时间:2011-09-19

来源:互联网

private void print()
  {
  String printCmd = "";
  if (dgPbbbList.SelectedRows.Count == 0)
  {
  MessageBox.Show("请选择要打印的行.");
  return;
  }
  for (int i = 0; i < dgPbbbList.SelectedRows.Count; i++)
  {
  String code = dgPbbbList.SelectedRows[i].Cells[0].Value + "$" + dgPbbbList.SelectedRows[i].Cells[2].Value;
  //code = BarCodeHelper.autoCode128ABC(code);
  printCmd += BarCodeHelper.getChinese(dgPbbbList.SelectedRows[i].Cells[1].Value.ToString(), dgPbbbList.SelectedRows[i].Cells[0].Value.ToString().GetHashCode().ToString());
  printCmd += "^XA^LH0,0^FO05,10^BCN," + codeHeight + ",,,,A^FD" + code + "^FS";
  //code = dgPbbbList.SelectedRows[i].Cells[3].Value.ToString();
  //code = BarCodeHelper.autoCode128ABC(code);
  //printCmd += "^FO05,90^BCN,40,,,,A^FD" + code + "^FS";
  //printCmd += "^CW1,E:MSUNG24.FNT^CI17^FO5,105^A1N,20,20^F8^FD" + dgPbbbList.Rows[i].Cells[1].Value + "^FS^XZ";
  printCmd += "^FO05,185^XGOUTSTR01,1,1^FS^XZ";
  }
  File.WriteAllText("barcode_print.txt", printCmd, UTF8Encoding.UTF8);
  Process.Start("cmd.exe", "/c \"copy \"" + AppDomain.CurrentDomain.BaseDirectory+"\\barcode_print.txt\" \"\\\\"+System.Configuration.ConfigurationSettings.AppSettings["ip"]+"\\"+printer.Text+"\"\"");
  }

作者: skip_zj   发布时间: 2011-09-19

你這個不是DELPHI代碼,也不知你問什麼問題。

作者: Oraclers   发布时间: 2011-09-19

热门下载

更多