有时候我们需要在HTML页面上显示条码。今天给大家分享在Barcode Professional中,如何将在HTML上显示条码。
步骤:
VB
Imports Neodynamic.WebControls.BarcodeProfessional
C#
using Neodynamic.WebControls.BarcodeProfessional;
VB
Dim bcp As New BarcodeProfessional bcp.Code = Request.QueryString("code") bcp.Symbology = Symbology.Code128 Dim barcodeImage As Byte() = bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Gif) If (barcodeImage Is Nothing) Then Response.End() Else Response.Clear() Response.ContentType = "image/gif" Response.BinaryWrite(barcodeImage) Response.End() End If
C#
BarcodeProfessional bcp = new BarcodeProfessional(); bcp.Code = Request.QueryString["code"]; bcp.Symbology = Symbology.Code128; byte[] barcodeImage = bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Gif); if(barcodeImage == null) Response.End(); else { Response.Clear(); Response.ContentType = "image/gif"; Response.BinaryWrite(barcodeImage); Response.End(); }