欢迎访问 生活随笔!

凯发k8官方网

当前位置: 凯发k8官方网 > 编程语言 > c# >内容正文

c#

【转】c#条形码 -凯发k8官方网

发布时间:2024/10/8 c# 0 豆豆
凯发k8官方网 收集整理的这篇文章主要介绍了 【转】c#条形码 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
code
#region c#条形码
        
public string bar_code(object str, int ch, int cw, int type_code)
        {
            
string strtmp=str.tostring();
            
string code=strtmp;
            strtmp
=strtmp.tolower();
            
int height=ch;
            
int width=cw;
            strtmp
=strtmp.replace("0", "_|_|__||_||_|");;
            strtmp
=strtmp.replace("1", "_||_|__|_|_||");
            strtmp
=strtmp.replace("2", "_|_||__|_|_||");
            strtmp
=strtmp.replace("3", "_||_||__|_|_|");
            strtmp
=strtmp.replace("4", "_|_|__||_|_||");
            strtmp
=strtmp.replace("5", "_||_|__||_|_|");
            strtmp
=strtmp.replace("7", "_|_|__|_||_||");
            strtmp
=strtmp.replace("6", "_|_||__||_|_|");
            strtmp
=strtmp.replace("8", "_||_|__|_||_|");
            strtmp
=strtmp.replace("9", "_|_||__|_||_|");
            strtmp
=strtmp.replace("a", "_||_|_|__|_||");
            strtmp
=strtmp.replace("b", "_|_||_|__|_||");
            strtmp
=strtmp.replace("c", "_||_||_|__|_|");
            strtmp
=strtmp.replace("d", "_|_|_||__|_||");
            strtmp
=strtmp.replace("e", "_||_|_||__|_|");
            strtmp
=strtmp.replace("f", "_|_||_||__|_|");
            strtmp
=strtmp.replace("g", "_|_|_|__||_||");
            strtmp
=strtmp.replace("h", "_||_|_|__||_|");
            strtmp
=strtmp.replace("i", "_|_||_|__||_|");
            strtmp
=strtmp.replace("j", "_|_|_||__||_|");
            strtmp
=strtmp.replace("k", "_||_|_|_|__||");
            strtmp
=strtmp.replace("l", "_|_||_|_|__||");
            strtmp
=strtmp.replace("m", "_||_||_|_|__|");
            strtmp
=strtmp.replace("n", "_|_|_||_|__||");
            strtmp
=strtmp.replace("o", "_||_|_||_|__|");
            strtmp
=strtmp.replace("p", "_|_||_||_|__|");
            strtmp
=strtmp.replace("r", "_||_|_|_||__|");
            strtmp
=strtmp.replace("q", "_|_|_|_||__||");
            strtmp
=strtmp.replace("s", "_|_||_|_||__|");
            strtmp
=strtmp.replace("t", "_|_|_||_||__|");
            strtmp
=strtmp.replace("u", "_||__|_|_|_||");
            strtmp
=strtmp.replace("v", "_|__||_|_|_||");
            strtmp
=strtmp.replace("w", "_||__||_|_|_|");
            strtmp
=strtmp.replace("x", "_|__|_||_|_||");
            strtmp
=strtmp.replace("y", "_||__|_||_|_|");
            strtmp
=strtmp.replace("z", "_|__||_||_|_|");
            strtmp
=strtmp.replace("-", "_|__|_|_||_||");
            strtmp
=strtmp.replace("*", "_|__|_||_||_|");
            strtmp
=strtmp.replace("/", "_|__|__|_|__|");
            strtmp
=strtmp.replace("%", "_|_|__|__|__|");
            strtmp
=strtmp.replace("", "_|__|_|__|__|");
            strtmp
=strtmp.replace(".", "_||__|_|_||_|");
            strtmp
=strtmp.replace("_", ""height";width:"width";background:#ffffff;'>");
            strtmp
=strtmp.replace("|", ""height";width:"width";background:#000000;'>");
            
if(type_code==1)
            {
                
return strtmp"
"code;
            }
            
else
            {
                
return strtmp;
            }
        }
        
#endregion

转载于:https://www.cnblogs.com/niuniu502/archive/2008/12/30/1365507.html

总结

以上是凯发k8官方网为你收集整理的【转】c#条形码的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得凯发k8官方网网站内容还不错,欢迎将凯发k8官方网推荐给好友。

网站地图