求一个c#条码打印的实例要源代码带效果的 求条c#形码打印的实例 要带源码 最好完整点的 50分双手送上 [email protected]有的发到这个邮箱中 谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 .......去和生产打印机的开发商去要sdk。就算给你代码,你也用不了阿. OnTheRoadService service = this.ServiceBLL.CurrentService; LastPrintList printList = new LastPrintList(); LastPrint last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER; last.CellWidth = 100; last.FontBold = true; last.FontSize = 14; last.Label = "G4S Cash Services"; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); string receNo = GetRectNo(); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 40; last.FontBold = false; last.FontSize = 10; last.Label = "Rect.No: "; last.Value = receNo; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); string tripNo = _tripDAO.GetTrip().AsstRef; last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 60; last.FontBold = false; last.FontSize = 10; last.Label = "Deliver By Trip:"; last.Value = tripNo; printList.Add(last); if (service != null) { last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 30; last.FontBold = false; last.FontSize = 10; last.Label = "Name: "; last.Value = service.LocRef; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 30; last.FontBold = false; last.FontSize = 10; last.Label = "Addr: "; last.Value = service.Location; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 30; last.FontBold = false; last.FontSize = 10; last.Label = "Town: "; last.Value = service.Town; printList.Add(last); } for (int i = 0; i < containers.Count; i++) { last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 70; last.FontBold = false; last.FontSize = 10; last.Label = containers[i].SealNo + " " + containers[i].Value; last.Value = "______"; printList.Add(last); } last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 30; last.FontBold = false; last.FontSize = 10; last.Label = "SEALS:"; last.Value = containers.Count + ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = "AC Card No."; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = _accBLL.GetAcc().AccNo; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = "_______________________________"; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = "Print Name"; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); last = new LastPrint(); last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT; last.CellWidth = 100; last.FontBold = false; last.FontSize = 10; last.Label = ""; last.Value = ""; printList.Add(last); _lastPrintList = printList; _isLoadReport = false; LastPrint(); LastPrint(); _printNumber++; _printCount = 2; BLLManager.UpdateLastPrintListNode(); } catch (Exception ex) { throw ex; } 你是说条码设计好之后 与条码打印机连接的代码么 还有sdk是什么 在这要怎么用啊 public string bar_code(object str, int ch, int cw, int type_code) { //str:输入的字符串;ch:要显示条形码的高度;cw:要显示条形码的宽度;type_code:代码类型 string strTmp = str.ToString(); string code = strTmp; // ToLower()将string转化成小写形式的副本,返回是使用指定区域的性的大小写规则。 strTmp = strTmp.ToLower(); int height = ch; int width = cw; //将传入的参数进行转化。 strTmp = strTmp.Replace("0", "_|_|__||_||_|"); strTmp = strTmp.Replace("1", "_||_|__|_|_||"); strTmp = strTmp.Replace("2", "_|_||__|_|_||"); strTmp = strTmp.Replace("3", "_||_||__|_|_|"); strTmp = strTmp.Replace("4", "_|_|__||_|_||"); strTmp = strTmp.Replace("5", "_||_|__||_|_|"); strTmp = strTmp.Replace("7", "_|_|__|_||_||"); strTmp = strTmp.Replace("6", "_|_||__||_|_|"); strTmp = strTmp.Replace("8", "_||_|__|_||_|"); strTmp = strTmp.Replace("9", "_|_||__|_||_|"); strTmp = strTmp.Replace("a", "_||_|_|__|_||"); strTmp = strTmp.Replace("b", "_|_||_|__|_||"); strTmp = strTmp.Replace("c", "_||_||_|__|_|"); strTmp = strTmp.Replace("d", "_|_|_||__|_||"); strTmp = strTmp.Replace("e", "_||_|_||__|_|"); strTmp = strTmp.Replace("f", "_|_||_||__|_|"); strTmp = strTmp.Replace("g", "_|_|_|__||_||"); strTmp = strTmp.Replace("h", "_||_|_|__||_|"); strTmp = strTmp.Replace("i", "_|_||_|__||_|"); strTmp = strTmp.Replace("j", "_|_|_||__||_|"); strTmp = strTmp.Replace("k", "_||_|_|_|__||"); strTmp = strTmp.Replace("l", "_|_||_|_|__||"); strTmp = strTmp.Replace("m", "_||_||_|_|__|"); strTmp = strTmp.Replace("n", "_|_|_||_|__||"); strTmp = strTmp.Replace("o", "_||_|_||_|__|"); strTmp = strTmp.Replace("p", "_|_||_||_|__|"); strTmp = strTmp.Replace("r", "_||_|_|_||__|"); strTmp = strTmp.Replace("q", "_|_|_|_||__||"); strTmp = strTmp.Replace("s", "_|_||_|_||__|"); strTmp = strTmp.Replace("t", "_|_|_||_||__|"); strTmp = strTmp.Replace("u", "_||__|_|_|_||"); strTmp = strTmp.Replace("v", "_|__||_|_|_||"); strTmp = strTmp.Replace("w", "_||__||_|_|_|"); strTmp = strTmp.Replace("x", "_|__|_||_|_||"); strTmp = strTmp.Replace("y", "_||__|_||_|_|"); strTmp = strTmp.Replace("z", "_|__||_||_|_|"); strTmp = strTmp.Replace("-", "_|__|_|_||_||"); strTmp = strTmp.Replace("*", "_|__|_||_||_|"); strTmp = strTmp.Replace("/", "_|__|__|_|__|"); strTmp = strTmp.Replace("%", "_|_|__|__|__|"); strTmp = strTmp.Replace("+", "_|__|_|__|__|"); strTmp = strTmp.Replace(".", "_||__|_|_||_|"); strTmp = strTmp.Replace("_", "<span style='height:" + height + ";width:" + width + ";background:#FFFFFF;'></span>"); strTmp = strTmp.Replace("|", "<span style='height:" + height + ";width:" + width + ";background:#000000;'></span>"); if (type_code == 1) { return strTmp + "<BR>" + code; } else { return strTmp; } }使用时,参数str的前后加*,不然条码枪是读不出的 win7系统 为什么装不上Visual Studio 2010旗舰版 非常感谢! C# 大家帮忙看下 这个数据库查询的结果 怎么用到这个判断语句中呢 C#怎样在类中修改窗口中的控件发件,求教 我做的winForm应用程序,可打开一个新窗口任务栏就增加一个窗口 vs.net 2003 怎样格式化代码呢? DataTable排序 急!急!急!哪位好心人帮帮小弟啊!!!!万分感谢!!!! C#中,如何定义配置文件? .Net通用WebService调用方法? 关于C#软件怎么让别人才可以使用? 大家帮忙看看 急 为什么老是出现死锁 散分!! UDP 客户端应答的问题!
就算给你代码,你也用不了阿.
OnTheRoadService service = this.ServiceBLL.CurrentService;
LastPrintList printList = new LastPrintList();
LastPrint last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER;
last.CellWidth = 100;
last.FontBold = true;
last.FontSize = 14;
last.Label = "G4S Cash Services";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last); string receNo = GetRectNo();
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 40;
last.FontBold = false;
last.FontSize = 10;
last.Label = "Rect.No: ";
last.Value = receNo;
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last); string tripNo = _tripDAO.GetTrip().AsstRef;
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 60;
last.FontBold = false;
last.FontSize = 10;
last.Label = "Deliver By Trip:";
last.Value = tripNo;
printList.Add(last); if (service != null)
{ last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 30;
last.FontBold = false;
last.FontSize = 10;
last.Label = "Name: ";
last.Value = service.LocRef;
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 30;
last.FontBold = false;
last.FontSize = 10;
last.Label = "Addr: ";
last.Value = service.Location;
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 30;
last.FontBold = false;
last.FontSize = 10;
last.Label = "Town: ";
last.Value = service.Town;
printList.Add(last);
}
for (int i = 0; i < containers.Count; i++)
{
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 70;
last.FontBold = false;
last.FontSize = 10;
last.Label = containers[i].SealNo + " " + containers[i].Value;
last.Value = "______";
printList.Add(last);
}
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last);
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 30;
last.FontBold = false;
last.FontSize = 10;
last.Label = "SEALS:";
last.Value = containers.Count + "";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "AC Card No.";
last.Value = "";
printList.Add(last);
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = _accBLL.GetAcc().AccNo;
last.Value = "";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "_______________________________";
last.Value = "";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_CENTER;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "Print Name";
last.Value = "";
printList.Add(last); last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last);
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last);
last = new LastPrint();
last.Align = ReportLayout.CELL_ALIGN.ALIGN_LEFT;
last.CellWidth = 100;
last.FontBold = false;
last.FontSize = 10;
last.Label = "";
last.Value = "";
printList.Add(last);
_lastPrintList = printList;
_isLoadReport = false;
LastPrint();
LastPrint();
_printNumber++;
_printCount = 2;
BLLManager.UpdateLastPrintListNode();
}
catch (Exception ex)
{
throw ex;
}
{
//str:输入的字符串;ch:要显示条形码的高度;cw:要显示条形码的宽度;type_code:代码类型
string strTmp = str.ToString();
string code = strTmp;
// ToLower()将string转化成小写形式的副本,返回是使用指定区域的性的大小写规则。
strTmp = strTmp.ToLower();
int height = ch;
int width = cw; //将传入的参数进行转化。
strTmp = strTmp.Replace("0", "_|_|__||_||_|");
strTmp = strTmp.Replace("1", "_||_|__|_|_||");
strTmp = strTmp.Replace("2", "_|_||__|_|_||");
strTmp = strTmp.Replace("3", "_||_||__|_|_|");
strTmp = strTmp.Replace("4", "_|_|__||_|_||");
strTmp = strTmp.Replace("5", "_||_|__||_|_|");
strTmp = strTmp.Replace("7", "_|_|__|_||_||");
strTmp = strTmp.Replace("6", "_|_||__||_|_|");
strTmp = strTmp.Replace("8", "_||_|__|_||_|");
strTmp = strTmp.Replace("9", "_|_||__|_||_|");
strTmp = strTmp.Replace("a", "_||_|_|__|_||");
strTmp = strTmp.Replace("b", "_|_||_|__|_||");
strTmp = strTmp.Replace("c", "_||_||_|__|_|");
strTmp = strTmp.Replace("d", "_|_|_||__|_||");
strTmp = strTmp.Replace("e", "_||_|_||__|_|");
strTmp = strTmp.Replace("f", "_|_||_||__|_|");
strTmp = strTmp.Replace("g", "_|_|_|__||_||");
strTmp = strTmp.Replace("h", "_||_|_|__||_|");
strTmp = strTmp.Replace("i", "_|_||_|__||_|");
strTmp = strTmp.Replace("j", "_|_|_||__||_|");
strTmp = strTmp.Replace("k", "_||_|_|_|__||");
strTmp = strTmp.Replace("l", "_|_||_|_|__||");
strTmp = strTmp.Replace("m", "_||_||_|_|__|");
strTmp = strTmp.Replace("n", "_|_|_||_|__||");
strTmp = strTmp.Replace("o", "_||_|_||_|__|");
strTmp = strTmp.Replace("p", "_|_||_||_|__|");
strTmp = strTmp.Replace("r", "_||_|_|_||__|");
strTmp = strTmp.Replace("q", "_|_|_|_||__||");
strTmp = strTmp.Replace("s", "_|_||_|_||__|");
strTmp = strTmp.Replace("t", "_|_|_||_||__|");
strTmp = strTmp.Replace("u", "_||__|_|_|_||");
strTmp = strTmp.Replace("v", "_|__||_|_|_||");
strTmp = strTmp.Replace("w", "_||__||_|_|_|");
strTmp = strTmp.Replace("x", "_|__|_||_|_||");
strTmp = strTmp.Replace("y", "_||__|_||_|_|");
strTmp = strTmp.Replace("z", "_|__||_||_|_|");
strTmp = strTmp.Replace("-", "_|__|_|_||_||");
strTmp = strTmp.Replace("*", "_|__|_||_||_|");
strTmp = strTmp.Replace("/", "_|__|__|_|__|");
strTmp = strTmp.Replace("%", "_|_|__|__|__|");
strTmp = strTmp.Replace("+", "_|__|_|__|__|");
strTmp = strTmp.Replace(".", "_||__|_|_||_|");
strTmp = strTmp.Replace("_", "<span style='height:" + height + ";width:" + width + ";background:#FFFFFF;'></span>");
strTmp = strTmp.Replace("|", "<span style='height:" + height + ";width:" + width + ";background:#000000;'></span>"); if (type_code == 1)
{
return strTmp + "<BR>" + code;
}
else
{
return strTmp;
}
}使用时,参数str的前后加*,不然条码枪是读不出的