Want to use the ASP. NET to realize the barcode function, online find the code is not complete.
Finally found a very full DLL is WinForm, originally thought could not be used on the web results can use.
First, the reference DLL does not have to be said, the following is the usage settings. There are a lot of setting parameters, I wonder.
DLL Http://pan.baidu.com/s/1jGfwcVc
Example code: Http://pan.baidu.com/s/1kT7etvD (Version WinForm)
Example code for ASP:
PublicActionResult Test () {varBar =NewCobainsoft.Windows.Forms.BarcodeControl (); Bar. Addoncaption=NULL; Bar. Addondata=NULL; Bar. BackColor=System.Drawing.Color.White; Bar. Barcodetype=Cobainsoft.Windows.Forms.BarcodeType.CODE39; Bar. Font=NewSystem.Drawing.Font ("Arial", 9F); Bar. ForeColor=System.Drawing.Color.Black; Bar. HorizontalAlignment=Cobainsoft.Windows.Forms.BarcodeHorizontalAlignment.Center; Bar. Invaliddataaction=Cobainsoft.Windows.Forms.InvalidDataAction.DisplayInvalid; Bar. Location=NewSystem.Drawing.Point (3,3); Bar. Lowertoptextby=0F; Bar. Raisebottomtextby=0F; Bar. Size=NewSystem.Drawing.Size (218, the); Bar. Barcodetype=The cobainsoft.windows.forms.barcodetype.code128c;//enumeration generates bar according to what format. Showcode39startstop=true;//Code39 If there is an asteriskBar. Data ="88808411";//Barcode DataBar. Addondata ="";//DateBar. TextPosition = Cobainsoft.Windows.Forms.BarcodeTextPosition.Below;//data displayed at the bottom of the barcodeBar. Stretchtext =true; Bar. CopyRight="Cydiy"; Bar. Invalidate (); //Stream stream = new FileStream ("D://100.png ", FileMode.Create, FileAccess.Write, Fileshare.none); //Bar. Makeimage (System.Drawing.Imaging.ImageFormat.Png, 1, +, true, false, NULL, stream);Bar. SaveImage (System.Drawing.Imaging.ImageFormat.Png,2, -,true,false,NULL,"D://1.png"); return NULL; }