大侠帮忙
时间: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+"\"\"");
}
{
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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28