今天就跟大家聊聊有關(guān)asp.net中怎么利用Zxing庫輸出條形碼,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
創(chuàng)新互聯(lián)是一家專業(yè)提供阿勒泰企業(yè)網(wǎng)站建設(shè),專注與網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站設(shè)計(jì)、H5建站、小程序制作等業(yè)務(wù)。10年已為阿勒泰眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設(shè)計(jì)公司優(yōu)惠進(jìn)行中。首先要在項(xiàng)目中添加zxing.dll引用
其次就是建立aspx文件,在后臺(tái)中代碼如下
using ZXing.Common; using ZXing; using ZXing.Rendering; using System.Drawing; using System.Drawing.Imaging; using ZXing.QrCode.Internal; namespace zxingtm { public partial class txm : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MultiFormatWriter mutiWriter = new MultiFormatWriter(); BitMatrix bm = mutiWriter.encode("123456789", BarcodeFormat.CODE_39, 363, 150); Bitmap img = new BarcodeWriter().Write(bm); img.Save("d:/1.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); } } }
代碼中“123456789”在測(cè)試中我是寫死的,用的時(shí)候可以用變量代替。BarcodeFormat.CODE_39等參數(shù)可以換成其他的,用以生成其他格式的條形碼
看完上述內(nèi)容,你們對(duì)asp.net中怎么利用Zxing庫輸出條形碼有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
文章題目:asp.net中怎么利用Zxing庫輸出條形碼-創(chuàng)新互聯(lián)
文章URL:http://aaarwkj.com/article48/ccgphp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、網(wǎng)站導(dǎo)航、小程序開發(fā)、定制網(wǎng)站、手機(jī)網(wǎng)站建設(shè)、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容