锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品999久久久,都市激情久久久久久久久久久,久久久久久久久久久久久久久久久久av http://www.aygfsteel.com/zhutianxiang/category/38094.htmlzh-cnSat, 04 Apr 2009 01:25:28 GMTSat, 04 Apr 2009 01:25:28 GMT60MD5鍔犲瘑http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263851.html摟鏈卞浜屽皯摟摟鏈卞浜屽皯摟Fri, 03 Apr 2009 17:28:00 GMThttp://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263851.htmlhttp://www.aygfsteel.com/zhutianxiang/comments/263851.htmlhttp://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263851.html#Feedback0http://www.aygfsteel.com/zhutianxiang/comments/commentRss/263851.htmlhttp://www.aygfsteel.com/zhutianxiang/services/trackbacks/263851.html/**
* MD5鍔犲瘑
*
* @param s
*            瑕佸姞瀵嗙殑瀛楃涓?涓嶅彲涓簄ull)
*
* @return 榪斿洖鍔犲瘑鍚庣殑瀵嗘枃
*/
public final static String MD5(String pwd) {
   String Digest = "";
   try {
     MessageDigest currentAlgorithm = MessageDigest.getInstance("md5");
     currentAlgorithm.reset();
     byte[] mess = pwd.getBytes();// 鑾峰彇瑕佸姞瀵嗙殑byte鏁扮粍
     byte[] hash = currentAlgorithm.digest(mess);// 鑾峰彇鍔犲瘑浠ュ悗鐨刡yte鏁扮粍
     for (int i = 0; i < hash.length; i++) {
        int v = hash[i];
        if (v < 0) {
            v = 256 + v; // 濡傛灉 v < 0 > 0 鐨勬暟錛屽惁鍒欎笉濂借漿鎹㈡垚瀛楃錛屽摢鏈堿SC浠g爜<0鐨勫憖
        }
        if (v < 16) {
            Digest += "0"; // 濡傛灉璇<1616榪涘埗鏁板氨鏄彧鏈変釜浣嶏紝渚嬪15杞崲灝辨垚闀垮害灝辯浉絳変簡
        }
        Digest += Integer.toString(v, 16).toUpperCase();
     }
     mess = null;
     hash = null;
   } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
   }
   return Digest;
}



]]>
鑷畾涔夊浘褰㈤獙璇佺爜鏍囩http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263848.html摟鏈卞浜屽皯摟摟鏈卞浜屽皯摟Fri, 03 Apr 2009 16:52:00 GMThttp://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263848.htmlhttp://www.aygfsteel.com/zhutianxiang/comments/263848.htmlhttp://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263848.html#Feedback0http://www.aygfsteel.com/zhutianxiang/comments/commentRss/263848.htmlhttp://www.aygfsteel.com/zhutianxiang/services/trackbacks/263848.html <%@ taglib uri="/htdz-tag" prefix="htdz-tag"%>
浣跨敤鑷畾涔夊浘褰㈤獙璇佺爜鏍囩鑷姩鐢熸垚楠岃瘉鐮?
<htdz-tag:CheckCodeTag />

浠ヤ笅涓鴻緇嗗畾涔夎繃紼嬶細
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
 version="2.0">
    <description>htdz tag</description>
    <display-name>htdz tag</display-name>
    <tlib-version>1.0</tlib-version>
    <short-name>htdz-tag</short-name>
    <uri>/htdz-tag</uri>

    <tag>

    <!--   
    楠岃瘉鐮佹帶浠?br />     浣跨敤璇存槑錛?br />     jsp涓嬌鐢ㄨ寖渚嬶細
    1.鏃犲弬鏁幫細<htdz-tag:CheckCodeTag/>
    2.鍏ㄩ儴鍙傛暟錛?lt;htdz-tag:CheckCodeTag id="checkCodeImg" height="18" width="58"/>
   
    濡傛灉鐢ㄦ埛鏈緗弬鏁幫紝鍒欓粯璁ゅ煎垎鍒負錛歨eight="18" width="58"
    -->
    <description>楠岃瘉鐮佹帶浠?lt;/description>
    <name>CheckCodeTag</name>
    <tag-class>com.htdz.util.tag.CheckCodeTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
        <description>id</description>
        <name>id</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <description>楂?lt;/description>
        <name>height</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <description>瀹?lt;/description>
        <name>width</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>

    </tag>
<taglib/>

CheckCodeTag.java:

public class CheckCodeTag extends TagSupport {
    private String id;
    private String height;
    private String width;

    public CheckCodeTag() {
    }

    @SuppressWarnings( { "unchecked", "static-access" })
    public int doStartTag() throws JspException {
        StringBuffer html = new StringBuffer();
        if (height == null || height.length() == 0)
            height = "18";
        if (width == null || width.length() == 0)
            width = "60";
        html.append("<img alt=\"閲嶆柊鑾峰彇楠岃瘉鐮乗"");
        if (id != null && id.length() > 0) {
            html.append(" id=\"");
            html.append(id);
            html.append("\"");
        }
        html.append(" height=\"");
        html.append(height);
        html.append("\" width=\"");
        html.append(width);
        html.append("\" src=\"/checkCodeImg\" onclick=\"this.src='/checkCodeImg?now='+new Date();\" style=\"cursor: pointer\" />");
        try {
            pageContext.getOut().println(html.toString());
        } catch (Exception e) {
            throw new JspException(e.getMessage());
        }
        return this.SKIP_BODY;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public void setWidth(String width) {
        this.width = width;
    }
}



web.xml:
    <servlet>
        <servlet-name>img</servlet-name>
        <servlet-class>com.htdz.util.CheckCodeImg</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>img</servlet-name>
        <url-pattern>/checkCodeImg</url-pattern>
    </servlet-mapping>


CheckCodeImg.java:

public class CheckCodeImg extends HttpServlet {
    private Font mFont = new Font("Arial black", Font.PLAIN, 16);

    public void init() throws ServletException {
        super.init();
    }

    Color getRandColor(int fc, int bc) {
        Random random = new Random();
        if (fc > 255)
            fc = 255;
        if (bc > 255)
            bc = 255;
        int r = fc + random.nextInt(bc - fc);
        int g = fc + random.nextInt(bc - fc);
        int b = fc + random.nextInt(bc - fc);
        return new Color(r, g, b);
    }

    public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
        response.setHeader("Pragma", "No-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
        response.setContentType("image/png");

        int width = 60, height = 18;
        BufferedImage image = new BufferedImage(width, height,
        BufferedImage.TYPE_INT_RGB);

        Graphics g = image.getGraphics();
        Random random = new Random();
        g.setColor(getRandColor(200, 250));
        g.fillRect(1, 1, width - 1, height - 1);
        g.setColor(new Color(102, 102, 102));
        g.drawRect(0, 0, width - 1, height - 1);
        g.setFont(mFont);

        g.setColor(getRandColor(160, 200));
        for (int i = 0; i < 155; i++) {
            int x = random.nextInt(width - 1);
            int y = random.nextInt(height - 1);
            int xl = random.nextInt(6) + 1;
            int yl = random.nextInt(12) + 1;
            g.drawLine(x, y, x + xl, y + yl);
        }
        for (int i = 0; i < 70; i++) {
            int x = random.nextInt(width - 1);
            int y = random.nextInt(height - 1);
            int xl = random.nextInt(12) + 1;
            int yl = random.nextInt(6) + 1;
            g.drawLine(x, y, x - xl, y - yl);
        }

        char[] codes = { // 'a','b','c','d','e','f','h','k','m','n','r','s','t','x','y',//15涓?br />                                      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
                                 // 'A','B','C','D','E','F','G','H','K','N','S','T','X','Y'//14
        };
        String sRand = "";
        for (int i = 0; i < 4; i++) {
            int j = random.nextInt(10);
            String tmp = String.valueOf(codes[j]);
            sRand += tmp;
            g.setColor(new Color(20 + random.nextInt(110), 20 + random
            .nextInt(110), 20 + random.nextInt(110)));
            g.drawString(tmp, 15 * i + 2, 15);
        }

        HttpSession session = request.getSession(true);
        session.setAttribute(MyConstant.SESSION_CHECKCODE, sRand);
        g.dispose();
        ImageIO.write(image, "PNG", response.getOutputStream());
   }
}



]]>
鑷畾涔夊垎欏墊爣絳?/title><link>http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263837.html</link><dc:creator>摟鏈卞浜屽皯摟</dc:creator><author>摟鏈卞浜屽皯摟</author><pubDate>Fri, 03 Apr 2009 16:23:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263837.html</guid><wfw:comment>http://www.aygfsteel.com/zhutianxiang/comments/263837.html</wfw:comment><comments>http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263837.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhutianxiang/comments/commentRss/263837.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhutianxiang/services/trackbacks/263837.html</trackback:ping><description><![CDATA[     鎽樿: 榪戞湡鍦ㄥ仛鐨凷2SH欏圭洰錛屽洜涓哄澶勭敤鍒板垎欏碉紝BOSS瑕佹眰灝忓紵灝嗗叾鎶借薄鍑烘潵銆傚皬寮熶笉鎵嶏紝瀹為檯鍙備笌寮鍙戠殑緇忛獙涔熷氨1騫淬?<br>浜庢槸鑺變簡鐐規椂闂村皢鍏跺仛鎴愯嚜瀹氫箟鏍囩渚涙墍鏈夐渶瑕佸垎欏電殑涓氬姟璋冪敤銆傚皬緇撲竴涓嬶紝渚涙柊鎵嬪弬鑰冦?nbsp; <a href='http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263837.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/zhutianxiang/aggbug/263837.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhutianxiang/" target="_blank">摟鏈卞浜屽皯摟</a> 2009-04-04 00:23 <a href="http://www.aygfsteel.com/zhutianxiang/archive/2009/04/04/263837.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">滕州市</a>| <a href="http://" target="_blank">乐亭县</a>| <a href="http://" target="_blank">玛纳斯县</a>| <a href="http://" target="_blank">化州市</a>| <a href="http://" target="_blank">海安县</a>| <a href="http://" target="_blank">祁连县</a>| <a href="http://" target="_blank">南木林县</a>| <a href="http://" target="_blank">富源县</a>| <a href="http://" target="_blank">仪陇县</a>| <a href="http://" target="_blank">兰考县</a>| <a href="http://" target="_blank">鹤峰县</a>| <a href="http://" target="_blank">西丰县</a>| <a href="http://" target="_blank">江华</a>| <a href="http://" target="_blank">广汉市</a>| <a href="http://" target="_blank">乌兰浩特市</a>| <a href="http://" target="_blank">三台县</a>| <a href="http://" target="_blank">蛟河市</a>| <a href="http://" target="_blank">禄丰县</a>| <a href="http://" target="_blank">乌兰察布市</a>| <a href="http://" target="_blank">怀安县</a>| <a href="http://" target="_blank">西昌市</a>| <a href="http://" target="_blank">山丹县</a>| <a href="http://" target="_blank">赤峰市</a>| <a href="http://" target="_blank">广州市</a>| <a href="http://" target="_blank">大姚县</a>| <a href="http://" target="_blank">和硕县</a>| <a href="http://" target="_blank">全椒县</a>| <a href="http://" target="_blank">邻水</a>| <a href="http://" target="_blank">永胜县</a>| <a href="http://" target="_blank">晋城</a>| <a href="http://" target="_blank">嘉荫县</a>| <a href="http://" target="_blank">铁岭市</a>| <a href="http://" target="_blank">诸暨市</a>| <a href="http://" target="_blank">泗洪县</a>| <a href="http://" target="_blank">广昌县</a>| <a href="http://" target="_blank">沈阳市</a>| <a href="http://" target="_blank">秦安县</a>| <a href="http://" target="_blank">广汉市</a>| <a href="http://" target="_blank">会昌县</a>| <a href="http://" target="_blank">宜兰县</a>| <a href="http://" target="_blank">红安县</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>