C 生成條形碼的類

2021-06-19 04:29:18 字數 2254 閱讀 9864

using system.collections;

using system.text.regularexpressions;

namespace dotnet.utilities

}catch

string result_html = ""; //html**

string color = ""; //顏色

foreach (char c in result_bin)

result_html += "

"; int len = ht['*'].tostring().length;

foreach (char c in s)

result_html += "

"; return "" + result_html + "

"; }

public static string getean13(string s, int width, int height)

$"))

$"))

else

}int sum_even = 0;//偶數字之和

int sum_odd = 0; //奇數字之和

for (int i = 0; i < 12; i++)

else

}int checkcode = (10 - (sum_even * 3 + sum_odd) % 10) % 10;//校驗碼

if (checkcode_input > 0 && checkcode_input != checkcode)

s += checkcode;//變成13位

// 000000000101左側42個01010右側35個校驗7個101000000000

// 6 101左側6位 01010右側5位校驗1位101000000000

string result_bin = "";//二進位制串

result_bin += "000000000101";

string type = ean13type(s[0]);

for (int i = 1; i < 7; i++)

result_bin += "01010";

for (int i = 7; i < 13; i++)

result_bin += "101000000000";

string result_html = ""; //html**

string color = ""; //顏色

int height_bottom = width * 5;

foreach (char c in result_bin)

result_html += "

"; result_html += "" + s[0] + "

"; result_html += "

"; result_html += "

"; result_html += "

"; for (int i = 1; i < 7; i++)

result_html += "

"; result_html += "

"; result_html += "

"; result_html += "

"; result_html += "

"; for (int i = 7; i < 13; i++)

result_html += "

"; result_html += "

"; result_html += "

"; result_html += "

"; result_html += "

"; return "" + result_html + "

"; }

private static string ean13(char c, char type)

}case 'b':

}case 'c':

}default: return "error!";}}

private static string ean13type(char c)}}

}//該**片段來自於:

生成條形碼

一 路由 routes.maproute name home url home getbar defaults new 二 html頁 text value id codenum button value 生成條形碼 onclick wds createbar width 200px height ...

條形碼生成

生成條形碼的類 public class barcode128dll set private font m valuefont new font 宋體 10 是否顯示可見號碼 如果為null不顯示號碼 public font valuefont set private byte m magnify ...

Asp生成條形碼

function haiwaocde zfstr zf zfstr zf replace zf,0 zf replace zf,1 zf replace zf,2 zf replace zf,3 zf replace zf,4 zf replace zf,5 zf replace zf,7 zf r...