使用.tiff的Asp vb绘制条形码 [英] Asp vb drawing barcode using a .tiff

查看:54
本文介绍了使用.tiff的Asp vb绘制条形码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要生成一个没有任何库的条形码(如果存在一个免费的商业广告),

i有这个代码但总是说

字体是ReadOnly,

i找到了很多页面但有人说怎么修复它

这是代码:



i need to generate a barcode without any library (if exist one commercial free),
i have this code but always said
Font is ReadOnly,
i found a lot of pages but any said how fix it
this is the code :

Imports System.Drawing
Imports System.Drawing.Text

Partial Class codigo_barras
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
        Dim family As FontFamily
        Dim pfc As PrivateFontCollection
        pfc = New PrivateFontCollection()
        pfc.AddFontFile("C:\Fonts\EAN-13.TTF")
        family = pfc.Families(0)

        TextBox1.Enabled = False
        TextBox1.Font = Font(family, 40.0F)
        TextBox2.Text = String.Format("*{0}*", "123456")

    End Sub

End Class





< b>我尝试了什么:



i试图找到如何解决它,但任何页面都说有用的东西,只有你使用库或dll,才能完美运行,但我需要没有任何库,或不支付商业用途

我现在不怎么修复这个错误,如果你做的Windows应用程序工作,但我需要在vb的asp.net 。



What I have tried:

i tried to find how fix it but any page said something usefull, only if you use libraries or dll, works perfectly, but i need without any library, or not pay for commercial use
and i don't now how fix this error, if you do for windows aplication works, but i nee for asp.net in vb.

推荐答案

可能你需要改变:

Probably you need to change:
TextBox1.Font = Font(family, 40.0F)

To:

To:

TextBox1.Font = New Font(family, 40.0F)


这篇关于使用.tiff的Asp vb绘制条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆