资源简介

ZXing一维码/二维码 使用文档 样例: System.IO.Stream stmYiWei = new System.IO.MemoryStream(); BitMatrix byteMatrix = new MultiFormatWriter().encode(sCode, BarcodeFormat.CODE_39, 230, 40); toBitmap(byteMatrix).Save(stmYiWei, ImageFormat.Bmp); Byte[] byteYiWei = new byte[stmYiWei.Length]; stmYiWei.Position = 0; stmYiWei.Read(byteYiWei, 0, (int)stmYiWei.Length); //将图片文件流保存为二进制文件以便保存到数据库中 System.IO.Stream stmErWei = new System.IO.MemoryStream(); IDictionary hints = new Dictionary(); hints.Add(EncodeHintType.CHARACTER_SET, "UTF-8"); byteMatrix = new MultiFormatWriter().encode(sTmp, BarcodeFormat.QR_CODE, 200, 200, hints); toBitmap(byteMatrix).Save(stmErWei, ImageFormat.Bmp); Byte[] byteErWei = new byte[stmErWei.Length]; stmErWei.Position = 0; stmErWei.Read(byteErWei, 0, (int)stmErWei.Length); //将图片文件流保存为二进制文件以便保存到数据库中 strSQL = "insert into gdzc_biaoqian( bq_gd_no,bq_yiweima,bq_erweima,bq_us_no) values("; strSQL = strSQL + " @bq_gd_no,@bq_yiweima,@bq_erweima,@bq_us_no)"; SqlCommand commandImage = new SqlCommand(strSQL, connectionImage); commandImage.Parameters.Clear(); commandImage.Parameters.Add("@bq_gd_no", SqlDbType.Int).Value = Convert.ToInt32(sGdzcNo); commandImage.Parameters.Add("@bq_yiweima", SqlDbType.Image).Value = byteYiWei; commandImage.Parameters.Add("@bq_erweima", SqlDbType.Image).Value = byteErWei; commandImage.Parameters.Add("@bq_us_no", SqlDbType.Int).Value = Convert.ToInt32(Session["LoginUserID"]); commandImage.ExecuteNonQuery(); commandImage.Dispose();

资源截图

代码片段和文件信息

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-08 03:50  Documentation\
     目录           0  2014-04-08 03:50  Documentation\net2.0\
     文件     3086074  2014-04-02 03:49  Documentation\net2.0\zxing.net2.0.chm
     目录           0  2014-04-08 03:50  Documentation\net3.5\
     文件     3056974  2014-04-02 04:26  Documentation\net3.5\zxing.net3.5.chm
     目录           0  2014-04-08 03:50  Documentation\net4.0\
     文件     3132711  2014-04-02 04:20  Documentation\net4.0\zxing.net.chm
     目录           0  2014-04-08 03:50  Documentation\portable\
     文件     3046590  2014-04-02 04:32  Documentation\portable\zxing.net.portable.chm
     目录           0  2014-04-08 03:50  Documentation\sl4\
     文件     2969955  2014-04-02 03:54  Documentation\sl4\zxing.sl4.chm
     目录           0  2014-04-08 03:50  Documentation\sl5\
     文件     3054921  2014-04-02 03:59  Documentation\sl5\zxing.sl5.chm
     目录           0  2014-04-08 03:50  Documentation\unity\
     文件     3055689  2014-04-02 04:04  Documentation\unity\zxing.unity.chm
     目录           0  2014-04-08 03:50  Documentation\wp7.0\
     文件     2968183  2014-04-02 04:10  Documentation\wp7.0\zxing.wp7.0.chm
     目录           0  2014-04-08 03:50  Documentation\wp7.1\
     文件     2969477  2014-04-02 04:15  Documentation\wp7.1\zxing.wp7.1.chm

评论

共有 条评论

相关资源