1、在要生成条形码的页面中增加Literal作为条形码的载体
2、在后台cs页面中增加方法,code即为要打印的编码
private void FillBarCode(string code)
{
IOrgSysParameter orgSysParameter = OrgSysParameterManageFactory.Create();
string ifVisibleBarCode, strBarCodeHeight, strBarCodeWidth;
int barCodeHeight, barCodeWidth;
orgSysParameter.GetIfVisibleBarCode(this.curUserRow.ORGID, out ifVisibleBarCode);
if (ifVisibleBarCode == IfVisibleBarCode.A.ToString())
{
orgSysParameter.GetBarCodeHeight(this.curUserRow.ORGID, out strBarCodeHeight);
orgSysParameter.GetBarCodeWidth(this.curUserRow.ORGID, out strBarCodeWidth);
barCodeHeight = int.Parse(strBarCodeHeight);
barCodeWidth = int.Parse(strBarCodeWidth);
this.Literal1.Text = BarCodeToHTML.get39(code, barCodeWidth, barCodeHeight);
this.Literal2.Text = BarCodeToHTML.get39(code, barCodeWidth, barCodeHeight);
this.Literal3.Text = BarCodeToHTML.get39(code, barCodeWidth, barCodeHeight);
}
}
3、在窗体的Page_Load事件中获取到code值之后使用该方法
this.FillBarCode(code);
通过以上3步即可以实现条形码的生成
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。