龙卷风(2007)

SQL2000、Dotnet、Oracle、PowerDesigner

用户操作
[即时聊天] [发私信] [加为好友]
邹黎鹏ID:zlp321002
94904次访问,排名980好友29人,关注者119
zlp321002的文章
原创 89 篇
翻译 2 篇
转载 2 篇
评论 32 篇
最近评论
my22xo:也发份给我吧,谢谢

iaocyf # 163.com

hertcloud:来发一个我的.
http://blog.csdn.net/hertcloud/category/281167.aspx
oushunbao:i = 50 * pagenum;

select top 50 * from (
select top 50 * from (
select top i * from tablename order by id asc
) as t1
order by id desc
) as t1<……
xinyu_1980:用游标来进行分页的取得, 不是什么好方法.
yizhibi10086:谢谢了,我们这几天在做jsp项目,正愁显示的分页问题,谢谢了
文章分类
收藏
    相册
    公司网站
    东方常智(二维码研发部)
    朋友网站链接
    泼猴网
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    转载 条码生成代码(Code39码)收藏

    新一篇: VS2005基于Microsoft Enterprise Library January 2006 的网站架构(一) | 旧一篇: 网页上生成一个印章。

     『Code 39条形码介绍』

     code39条码能表示字母、数字和其它一些符号共43个字符:A -Z, 0-9, -.$/ + %, space等,其主要特点如下:
      ◆条码的长度是可变化的
      ◆通常用“*”号作为起始、终止符
      ◆校验码不用
      ◆代码密度介于3 - 9.4个字符/每英寸       
      ◆空白区是窄条的10倍
      ◆用于工业、图书、以及票证自动化管理上

    三九码是Intermec公司于1975年推出的一种条码,它可表示数字、英文字母以及“-”、“.”、“/”、“ ”、“%”、“$”、“ ”(空格)和“*”共44个符号,其中“*”仅作为启始符和终止符。
    三九码且有编码规则简单、误码率低、所能表示字符个数多等特点,因此在各个领域有着极为广泛的应用。我国也制定了相应的国家标准(GB12908-91)。
    三九码仅有两种单元宽度——分别为宽单元和窄单元。宽单元这宽度为窄单元的1到3倍,一般多选用2倍、2.5倍或3倍。三九码的每一个条码字符由九个单元组成,其中有三个宽单元,其余是窄单元,因此称为三九码。
    我国有的图书馆使用的39码使用了特殊的校验字符,条码软件都可打印适用于图书馆的39码。

    代码原创: LovlyPuppy

    实现该功能分两个类,第一个类 DrawImageBord.cs

    using System.Drawing;
    using System.Drawing.Imaging;
    public   abstract   class   DrawImageBord 
     

         
    protected   virtual   string   BordRuleName 
          

             
    get   {   return   string.Empty;   } 
          }
     

         
    protected   virtual   System.Collections.Hashtable   Roles 
          

             
    get   {   return   new   System.Collections.Hashtable();   } 
          }
     

         
    string   drawString; 
         
    int   width   =   800;   //画布的宽度(可计算) 
         int   height   =   36;//1CM 
         int   unitWidth   =   1;   // 

         
    int   currentLocation   =   0

         
    public   DrawImageBord(string   s) 
         

             drawString   
    =   s; 
         }
     

         
    public   virtual   void   Draw(System.IO.Stream   target) 
         

             Bitmap   bm   
    =   new   Bitmap(width,   height); 
             Graphics   g   
    =   Graphics.FromImage(bm); 
             g.SmoothingMode   
    =   System.Drawing.Drawing2D.SmoothingMode.Default; 
             g.TextRenderingHint   
    =   System.Drawing.Text.TextRenderingHint.AntiAlias; 

             
    //画布和边的设定   
             g.Clear(Color.White); 

             g.DrawRectangle(Pens.White,   
    0,   0,   width,   height); 
             
    for(int   i   =   0;   i   <   drawString.Length;   i++
                   

                       
    this.DrawString(drawString[i].ToString(),   g); 
                   }
     
            bm.Save(target,   ImageFormat.Jpeg); 
         }
     
        
    protected   virtual   void   DrawString(string   s,   Graphics   g) 
        

              System.Collections.Hashtable   hash   
    =   this.Roles; 
              
    object   o   =   hash[s]; 
              
    if   (o   ==   null)   return
              
    char[]   chars   =   o.ToString().ToCharArray(); 
              
    if   (chars.Length   >   9)   return
                  SolidBrush   blackBrush   
    =   new   SolidBrush(Color.Black); 
                  SolidBrush   witeBrush   
    =   new   SolidBrush(Color.White); 

               
    for(int   i   =   0;   i   <   5;   i++
                  

                     
    //画第一个   0   黑条 
                      if   (chars[i]   ==   '0'
                      

                             Rectangle   re1   
    =   new   Rectangle(currentLocation,   0,   unitWidth,   height); 
                             g.FillRectangle(blackBrush,   re1); 
                             currentLocation   
    +=   unitWidth; 
                      }
     
                      
    else 
                      

                             Rectangle   re1   
    =   new   Rectangle(currentLocation,   0,   3   *   unitWidth,   height); 
                             g.FillRectangle(blackBrush,   re1); 
                             currentLocation   
    +=   3   *   unitWidth; 
                      }
     
                     
    //画第6个     5   白条 
                      if   ((i   +   5)   <   9
                      

                           
    if   (chars[i+5==  '0'
                           

                                 Rectangle   re1   
    =   new   Rectangle(currentLocation,   0,   unitWidth,   height); 
                                 g.FillRectangle(witeBrush,   re1); 
                                 currentLocation   
    +=   unitWidth; 
                           }
     
                           
    else 
                           

                                   Rectangle   re1   
    =   new   Rectangle(currentLocation,   0,   3   *   unitWidth,   height); 
                                   g.FillRectangle(witeBrush,   re1); 
                                   currentLocation   
    +=   3   *   unitWidth; 
                           }
     
                      }
     
                   }
     
                     Rectangle   re2   
    =   new   Rectangle(currentLocation,   0,   unitWidth,   height); 
                     g.FillRectangle(witeBrush,   re2); 
                    currentLocation   
    +=   unitWidth; 

        }
     
    }
     

     

    第二个类CODE39DrawImageBord.cs 继承DrawImageBord.cs

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    /**//// <summary>
    /// CODE39DrawImageBord 的摘要说明
    /// </summary>

    public class CODE39DrawImageBord : DrawImageBord
    ...
    {
        
    private System.Collections.Hashtable hash = new System.Collections.Hashtable();
        
    protected override string BordRuleName
        ...
    {
            
    get ...return "CODE39"; }
        }

        
    public CODE39DrawImageBord(string s)
            : 
    base(s)
        ...
    {

        }


        
    protected override System.Collections.Hashtable Roles
        ...
    {
            
    get
            ...
    {
                
    if (hash.Count > 0return hash;
                hash.Add(
    "0""001100100");
                hash.Add(
    "1""100010100");
                hash.Add(
    "2""010010100");
                hash.Add(
    "3""110000100");
                hash.Add(
    "4""001010100");
                hash.Add(
    "5""101000100");
                hash.Add(
    "6""011000100");
                hash.Add(
    "7""000110100");

                hash.Add(
    "8""100100100");
                hash.Add(
    "9""010100100");
                hash.Add(
    "A""100010010");
                hash.Add(
    "B""010010010");
                hash.Add(
    "C""110000010");
                hash.Add(
    "D""001010010");
                hash.Add(
    "E""101000010");

                hash.Add(
    "F""011000010");
                hash.Add(
    "G""000110010");
                hash.Add(
    "H""100100010");
                hash.Add(
    "I""010100010");
                hash.Add(
    "J""001100010");
                hash.Add(
    "K""100010001");
                hash.Add(
    "L""010010001");

                hash.Add(
    "M""110000001");
                hash.Add(
    "N""001010001");
                hash.Add(
    "O""101000001");
                hash.Add(
    "P""011000001");
                hash.Add(
    "Q""000110001");
                hash.Add(
    "R""100100001");
                hash.Add(
    "S""010100001");


                hash.Add(
    "T""001100001");
                hash.Add(
    "U""100011000");
                hash.Add(
    "V""010011000");
                hash.Add(
    "W""110001000");
                hash.Add(
    "X""001011000");
                hash.Add(
    "Y""101001000");
                hash.Add(
    "Z""011001000");


                hash.Add(
    "-""000111000");
                hash.Add(
    "%""100101000");
                hash.Add(
    "$""010101000");
                hash.Add(
    "*""001101000");

                
    return hash;
            }

        }
     
    }

     

    调用的方法:

      protected void Page_Load(object sender, EventArgs e)
        
    {
            CODE39DrawImageBord dr 
    = new CODE39DrawImageBord("*3949178*");
            dr.Draw(Response.OutputStream); 

        }

     

    --显示结果:

     

    补充说明:

    生成的这个条码,并没有用扫描枪去识别,
    以后我会用Symbol DS6608数字扫描器 来识别它的准确性.


    发表于 @ 2007年12月28日 01:41:00|评论(loading...)|编辑

    新一篇: VS2005基于Microsoft Enterprise Library January 2006 的网站架构(一) | 旧一篇: 网页上生成一个印章。

    评论:没有评论。

    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 邹黎鹏