免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開(kāi)通VIP
Barcode Professional for ASP.NET使用教程:HTML頁(yè)面顯示條碼

有時(shí)候我們需要在HTML頁(yè)面上顯示條碼。今天給大家分享在Barcode Professional中,如何將在HTML上顯示條碼。

【Barcode Professional for ASP.NET下載】

步驟:

  • 打開(kāi).NET開(kāi)發(fā)工具,如 Visual Studio .NET 。創(chuàng)建一個(gè)新的ASP.NET Web應(yīng)用
  • 為了HTML頁(yè)面上能正顯示條碼,我們需要?jiǎng)?chuàng)建一個(gè)ASP.NET WebForm 和 HTTP Handler。
  • 添加引用到Barcode Professional
  • 在BarcodeGen.aspx's 的代碼文件里,添加下面的空間命名引用

VB

Imports Neodynamic.WebControls.BarcodeProfessional

C#

using Neodynamic.WebControls.BarcodeProfessional;
  • BarcodeGen.aspx 頁(yè)面將通過(guò)字符串查詢收到編碼的參數(shù),在Page_Load 事件中,可以用Barcode Professional 來(lái)生成條碼,可參考下面的代碼:

VB

Dim bcp As New BarcodeProfessionalbcp.Code = Request.QueryString("code")bcp.Symbology = Symbology.Code128Dim barcodeImage As Byte() = bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Gif)If (barcodeImage Is Nothing) ThenResponse.End()ElseResponse.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();}
  • 添加一個(gè)HTML頁(yè)面,可命名BarcodeTest.htm,在這個(gè)頁(yè)面里有腳本代碼可以用來(lái)添加動(dòng)態(tài)條碼。參考代碼:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title>Barcode Professional in a HTML Page</title><script type="text/javascript">function ChangeBarcode(code){var elem = document.getElementById("imgBarcode");if(elem!=null)elem.src="BarcodeGen.aspx?code="+code;}</script></head><body><P><FONT face="Arial"><b>Barcode Professional in a HTML page</b></FONT></P><P><IMG id="imgBarcode" alt="" src="BarcodeGen.aspx?code=12300445"></P><P><FONT face="Arial" size="2">Enter a value to encode:</FONT><BR><INPUT id="Text1" type="text" name="Text1"><INPUT id="Button1" type="button" value="View Barcode" name="Button1"onclick="ChangeBarcode(Text1.value)"></P></body></html>
  • 就這樣建立了 ASP.NET Web 應(yīng)用,打開(kāi)BarcodeTest.htm ,輸入代碼,單擊“查看條碼”按鈕,可查看生成的條碼。
原文譯自barcode
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
基于Metronic的Bootstrap開(kāi)發(fā)框架經(jīng)驗(yàn)總結(jié)(14)--條碼和二維碼的生成及打印處理
各國(guó)條碼
條碼打印設(shè)置
條形碼編程實(shí)例
SAP條碼學(xué)習(xí)筆記
使用jQuery監(jiān)聽(tīng)掃碼槍輸入并禁止手動(dòng)輸入的實(shí)現(xiàn)方法
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服