锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲va中文字幕无码久久不卡,亚洲国产精品国产自在在线,亚洲色成人中文字幕网站http://m.tkk7.com/yeeyang/category/39634.htmlzh-cnMon, 25 May 2009 10:28:54 GMTMon, 25 May 2009 10:28:54 GMT60JAVA錛欽TextField鏂囨湰妗嗚緭鍏ヨ繃婊?/title><link>http://m.tkk7.com/yeeyang/articles/LimitedDocument.html</link><dc:creator>YeeYang</dc:creator><author>YeeYang</author><pubDate>Mon, 25 May 2009 02:32:00 GMT</pubDate><guid>http://m.tkk7.com/yeeyang/articles/LimitedDocument.html</guid><wfw:comment>http://m.tkk7.com/yeeyang/comments/271177.html</wfw:comment><comments>http://m.tkk7.com/yeeyang/articles/LimitedDocument.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/yeeyang/comments/commentRss/271177.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/yeeyang/services/trackbacks/271177.html</trackback:ping><description><![CDATA[<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.swing.text.AttributeSet;<br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.swing.text.BadLocationException;<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.swing.text.PlainDocument;<br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> LimitedDocument </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> PlainDocument {<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> maxLength </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> String allowCharAsString </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> LimitedDocument() {<br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">();<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> LimitedDocument(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> maxLength, String str) {<br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">();<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.maxLength </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> maxLength;<br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">        allowCharAsString </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> str;<br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);">    @Override<br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> insertString(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> offset, String str, AttributeSet attrSet)<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> BadLocationException {<br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (str </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">27</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">28</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (allowCharAsString </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> str.length() </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">29</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (allowCharAsString.indexOf(str) </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">30</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">31</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">32</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">33</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">34</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">[] charVal </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> str.toCharArray();<br /> </span><span style="color: rgb(0, 128, 128);">35</span> <span style="color: rgb(0, 0, 0);">        String strOldValue </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> getText(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">, getLength());<br /> </span><span style="color: rgb(0, 128, 128);">36</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[] tmp </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> strOldValue.getBytes();<br /> </span><span style="color: rgb(0, 128, 128);">37</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">38</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (maxLength </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> (tmp.length </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> charVal.length </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> maxLength)) {<br /> </span><span style="color: rgb(0, 128, 128);">39</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">40</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">41</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">42</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">.insertString(offset, str, attrSet);<br /> </span><span style="color: rgb(0, 128, 128);">43</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">44</span> <span style="color: rgb(0, 0, 0);">}</span></div> <br />        鐢ㄦ硶錛?br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);">1</span> <span style="color: rgb(0, 0, 0);">LimitedDocument Input </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> LimitedDocument(maxLength,allowCharAsString);<br /> </span><span style="color: rgb(0, 128, 128);">2</span> <span style="color: rgb(0, 0, 0);">maxLength 涓烘渶澶ц緭鍏ラ暱搴︼紝allowCharAsString 涓哄厑璁歌緭鍏ョ殑瀛楃<br /> </span><span style="color: rgb(0, 128, 128);">3</span> <span style="color: rgb(0, 0, 0);">jTextField.setDocument(Input); 榪愮敤鍒版枃鏈涓?/span></div> <br />        渚嬪錛?br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);">1</span> <span style="color: rgb(0, 0, 0);">String AllowChar </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">0123456789</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">2</span> <span style="color: rgb(0, 0, 0);">LimitedDocument Input </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> LimitedDocument(</span><span style="color: rgb(0, 0, 0);">11</span><span style="color: rgb(0, 0, 0);">,AllowChar)</span></div> <br /> <br /> <img src ="http://m.tkk7.com/yeeyang/aggbug/271177.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/yeeyang/" target="_blank">YeeYang</a> 2009-05-25 10:32 <a href="http://m.tkk7.com/yeeyang/articles/LimitedDocument.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JAVA錛欴ES鍙嗗姞瀵嗙畻娉?/title><link>http://m.tkk7.com/yeeyang/articles/DESPlus.html</link><dc:creator>YeeYang</dc:creator><author>YeeYang</author><pubDate>Sun, 24 May 2009 03:18:00 GMT</pubDate><guid>http://m.tkk7.com/yeeyang/articles/DESPlus.html</guid><wfw:comment>http://m.tkk7.com/yeeyang/comments/271175.html</wfw:comment><comments>http://m.tkk7.com/yeeyang/articles/DESPlus.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/yeeyang/comments/commentRss/271175.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/yeeyang/services/trackbacks/271175.html</trackback:ping><description><![CDATA[     鎽樿: import java.security.*; <br>import javax.crypto.*; <br> <br>public class DESPlus { <br> private static String strDefaultKey = "national"; <br> private Cipher encryptCipher = null; <br> private Cipher decryptCipher = null; <br> <br> /** <br> * 灝哹yte鏁扮粍杞崲涓鴻〃紺?6榪涘埗鍊肩殑瀛楃涓詫紝 濡傦細(xì)byte[]{8,18}杞崲涓猴細(xì)0813錛?鍜宲ublic static byte[] <br> * hexStr2ByteArr(String strIn) 浜掍負(fù)鍙嗙殑杞崲榪囩▼ <br> * <br> * @param arrB <br> * 闇瑕佽漿鎹㈢殑byte鏁扮粍 <br> * @return 杞崲鍚庣殑瀛楃涓?<br> * @throws Exception <br> * 鏈柟娉曚笉澶勭悊浠諱綍寮傚父  <a href='http://m.tkk7.com/yeeyang/articles/DESPlus.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/yeeyang/aggbug/271175.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/yeeyang/" target="_blank">YeeYang</a> 2009-05-24 11:18 <a href="http://m.tkk7.com/yeeyang/articles/DESPlus.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JAVA錛歁D5涓嶅彲閫嗗姞瀵嗙畻娉?/title><link>http://m.tkk7.com/yeeyang/articles/MD5.html</link><dc:creator>YeeYang</dc:creator><author>YeeYang</author><pubDate>Sat, 23 May 2009 02:27:00 GMT</pubDate><guid>http://m.tkk7.com/yeeyang/articles/MD5.html</guid><wfw:comment>http://m.tkk7.com/yeeyang/comments/271176.html</wfw:comment><comments>http://m.tkk7.com/yeeyang/articles/MD5.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/yeeyang/comments/commentRss/271176.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/yeeyang/services/trackbacks/271176.html</trackback:ping><description><![CDATA[<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.security.MessageDigest;<br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.security.</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.security.spec.</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 128, 0);"> * To change this template, choose Tools | Templates<br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 128, 0);"> * and open the template in the editor.<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 128, 0);"> </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 128, 0);"> *<br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 128, 0);"> * </span><span style="color: rgb(128, 128, 128);">@author</span><span style="color: rgb(0, 128, 0);"> Administrator<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 128, 0);"> </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> MD5 {<br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">final</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> String MD5(String s) {<br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> hexDigits[] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> {<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">6</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">7</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">9</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">a</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">b</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">c</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">d</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,<br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">e</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">f</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);">        };<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[] strTemp </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> s.getBytes();<br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">            MessageDigest mdTemp </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> MessageDigest.getInstance(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">MD5</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">            mdTemp.update(strTemp);<br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[] md </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> mdTemp.digest();<br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> md.length;<br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> str[] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);">[j </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">];<br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> k </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">27</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> j; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">28</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);"> byte0 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> md[i];<br /> </span><span style="color: rgb(0, 128, 128);">29</span> <span style="color: rgb(0, 0, 0);">                str[k</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> hexDigits[byte0 </span><span style="color: rgb(0, 0, 0);">>>></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0xf</span><span style="color: rgb(0, 0, 0);">];<br /> </span><span style="color: rgb(0, 128, 128);">30</span> <span style="color: rgb(0, 0, 0);">                str[k</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> hexDigits[byte0 </span><span style="color: rgb(0, 0, 0);">&</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0xf</span><span style="color: rgb(0, 0, 0);">];<br /> </span><span style="color: rgb(0, 128, 128);">31</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">32</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> String(str);<br /> </span><span style="color: rgb(0, 128, 128);">33</span> <span style="color: rgb(0, 0, 0);">        } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br /> </span><span style="color: rgb(0, 128, 128);">34</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">35</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">36</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">37</span> <span style="color: rgb(0, 0, 0);">}<br /> </span><span style="color: rgb(0, 128, 128);">38</span> </div> <img src ="http://m.tkk7.com/yeeyang/aggbug/271176.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/yeeyang/" target="_blank">YeeYang</a> 2009-05-23 10:27 <a href="http://m.tkk7.com/yeeyang/articles/MD5.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JAVA錛氬JFrame紿楀彛鐨勪竴浜涙搷浣滐紙涓漢绱Н錛?/title><link>http://m.tkk7.com/yeeyang/articles/JFrame_operation.html</link><dc:creator>YeeYang</dc:creator><author>YeeYang</author><pubDate>Fri, 22 May 2009 02:35:00 GMT</pubDate><guid>http://m.tkk7.com/yeeyang/articles/JFrame_operation.html</guid><wfw:comment>http://m.tkk7.com/yeeyang/comments/271261.html</wfw:comment><comments>http://m.tkk7.com/yeeyang/articles/JFrame_operation.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/yeeyang/comments/commentRss/271261.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/yeeyang/services/trackbacks/271261.html</trackback:ping><description><![CDATA[      涓嬮潰灝辨槸鍦╦Frame涓嬬殑涓浜涙柟娉曠粡楠岀Н绱紝鍙兘寰堝井灝忓緢涓嶈搗鐪鹼紝鎴栬瀵規(guī)柊鎵嬫湁鐐圭偣甯姪錛屾垜浼?xì)涓嶅畾鏃舵洿鏂颁竴涓嬬殑錛?br /> <br />        1錛夋敼鍙樼晫闈負(fù)緋葷粺榛樿鐘舵侊細(xì)<br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008080;"> 1</span>     <span style="color: #008000;">//</span><span style="color: #008000;">闇瑕佸鍏ヨ繖涓寘</span><span style="color: #008000;"><br /> </span><span style="color: #008080;"> 2</span>     <span style="color: #0000ff;">import</span><span style="color: #000000;"> javax.swing.UIManager;<br /> </span><span style="color: #008080;"> 3</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;"> 4</span> <span style="color: #000000;">    </span><span style="color: #008000;">//</span><span style="color: #008000;">鏀瑰彉鐣岄潰涓虹郴緇熼粯璁ょ姸鎬?nbsp; </span><span style="color: #008000;"><br /> </span><span style="color: #008080;"> 5</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;"> 6</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">try</span><span style="color: #000000;"> {<br /> </span><span style="color: #008080;"> 7</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;"> 8</span> <span style="color: #000000;">        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());  </span><span style="color: #008000;">//</span><span style="color: #008000;">璁劇疆鐣岄潰鏍峰紡</span><span style="color: #008000;"><br /> </span><span style="color: #008080;"> 9</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;">10</span> <span style="color: #000000;">        javax.swing.SwingUtilities.updateComponentTreeUI(</span><span style="color: #0000ff;">this</span><span style="color: #000000;">);  </span><span style="color: #008000;">//</span><span style="color: #008000;">鏇存柊鐣岄潰</span><span style="color: #008000;"><br /> </span><span style="color: #008080;">11</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;">12</span> <span style="color: #000000;">    } </span><span style="color: #0000ff;">catch</span><span style="color: #000000;"> (Exception ex) {  </span><span style="color: #008000;">//</span><span style="color: #008000;">鎹曟崏閿欒</span><span style="color: #008000;"><br /> </span><span style="color: #008080;">13</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;">14</span> <span style="color: #000000;">        ex.printStackTrace();  </span><span style="color: #008000;">//</span><span style="color: #008000;">杈撳嚭閿欒</span><span style="color: #008000;"><br /> </span><span style="color: #008080;">15</span> <span style="color: #000000;"><br /> </span><span style="color: #008080;">16</span> <span style="color: #000000;">    }</span></div> <br />        2錛夊彇娑堢獥鍙g殑鏈澶у寲錛?br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008080;">1</span> <span style="color: #000000;">    setResizable(</span><span style="color: #0000ff;">false</span><span style="color: #000000;">);  </span><span style="color: #008000;">//</span><span style="color: #008000;">鍙栨秷鏈澶у寲</span></div> <br />         3錛夌獥鍙e眳涓樉紺猴細(xì)<br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008080;">1</span> <span style="color: #000000;">    setLocationRelativeTo(</span><span style="color: #0000ff;">null</span><span style="color: #000000;">);  </span><span style="color: #008000;">//</span><span style="color: #008000;">灞呬腑鏄劇ず</span></div> <br />         4錛夊彇娑堟爣棰樻爮鏄劇ず錛?br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008080;">1</span> <span style="color: #000000;">    setUndecorated(</span><span style="color: #0000ff;">true</span><span style="color: #000000;">);  </span><span style="color: #008000;">//</span><span style="color: #008000;">鍙栨秷鏍囬鏍忔樉紺?/span></div>       娉ㄦ剰錛氳繖涓柟娉曟槸浠巎dk1.4鐗堟湰浠ュ悗澧炲姞鐨勶紝浠ュ墠鐗堟湰鏄病鏈夌殑錛涜繖涓柟娉曞繀欏誨湪jFrame鏄劇ず涔嬪墠璋冪敤錛屾樉紺轟箣鍚庤皟鐢紝浼?xì)鍑洪敊锛?br /> <br /> <br /> <img src ="http://m.tkk7.com/yeeyang/aggbug/271261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/yeeyang/" target="_blank">YeeYang</a> 2009-05-22 10:35 <a href="http://m.tkk7.com/yeeyang/articles/JFrame_operation.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JAVA錛氳幏鍙栨湰鏈哄緗慖P鍦板潃鐨勫皬宸ュ叿http://m.tkk7.com/yeeyang/articles/JAVA_GetPublicIP.htmlYeeYangYeeYangTue, 19 May 2009 15:35:00 GMThttp://m.tkk7.com/yeeyang/articles/JAVA_GetPublicIP.htmlhttp://m.tkk7.com/yeeyang/comments/271625.htmlhttp://m.tkk7.com/yeeyang/articles/JAVA_GetPublicIP.html#Feedback0http://m.tkk7.com/yeeyang/comments/commentRss/271625.htmlhttp://m.tkk7.com/yeeyang/services/trackbacks/271625.html
      鎻愪緵鍑犱釜鏌P鍙嶅洖欏甸潰鐩稿綆鍗曠殑緗戝潃錛岃闂笉鍚岀殑緗戝潃錛岃鍙栧叧閿瓧絎︿覆鐨勬椂鍊欏彲鑳戒細(xì)涓嶅悓錛岃鍋氬嚭鐩稿簲鐨勪慨鏀廣?br />

      涓嬮潰鏄▼搴忕殑婧愮爜錛屽彲浠ュ弬鑰冧竴涓嬶細(xì)

  1 import java.io.File;
  2 import java.io.FileReader;
  3 import java.io.BufferedReader;
  4 import java.io.FileOutputStream;
  5 import java.io.IOException;
  6 import java.io.InputStream;
  7 import java.net.HttpURLConnection;
  8 import java.net.MalformedURLException;
  9 import java.net.URL;
 10 import javax.swing.JOptionPane;
 11 
 12 /**
 13  * GetPublicIP 綾?br />  14  * 
 15  * @author YeeYang
 16  * 
 17  * @version 1.0
 18  * 
 19  */
 20 public class GetPublicIP {
 21 
 22     /**/
 23     /**
 24      * 涓葷▼搴忓叆鍙?br />  25      * 
 26      * @param args
 27      *            杈撳叆鍙傛暟鏁扮粍
 28      */
 29     public static void main(String[] args) {
 30         String pIP = GetPublicIP("http://www.bliao.com/ip.phtml""IP_Temp.tmp");
 31         JOptionPane.showConfirmDialog(null, pIP, "鎮(zhèn)ㄧ殑澶栫綉IP鍦板潃",
 32                 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
 33     }
 34 
 35     /**/
 36     /**
 37      * 鑾峰彇宸蹭笅杞界殑鏂囦歡閲岀殑瀛楃涓?IP鍦板潃)
 38      * 
 39      * @return 鑾峰彇鐨勫緗慖P鍦板潃
 40      * @throws Exception
 41      */
 42     public static String GetPublicIP(String urlStr, String tempSaveStr) {
 43 
 44         // 涓嬭澆鎿嶄綔 - 寮濮?nbsp;錛氫笅杞界綉緇滄枃浠惰幏鍙栫浉鍏矷P鍦板潃騫朵繚瀛樹(shù)負(fù)涓存椂鏂囦歡IP.shtml
 45         int chByte = 0// 璇誨叆杈撳叆嫻佺殑鏁版嵁闀垮害
 46         URL url = null// 緗戠粶鐨剈rl鍦板潃
 47         HttpURLConnection httpConn = null// http榪炴帴
 48         InputStream in = null// 杈撳叆嫻?/span>
 49         FileOutputStream out = null// 鏂囦歡杈撳嚭嫻?/span>
 50         try {
 51             url = new URL(urlStr);
 52             httpConn = (HttpURLConnection) url.openConnection();
 53             HttpURLConnection.setFollowRedirects(true);
 54             httpConn.setRequestMethod("GET");
 55             httpConn.setRequestProperty("User-Agent",
 56                     "Mozilla/4.0 (compatible; MSIE 6.0; Windows 2000)");
 57 
 58             in = httpConn.getInputStream();
 59             out = new FileOutputStream(new File("tempSaveStr"));
 60 
 61             chByte = in.read();
 62             while (chByte != -1) {
 63                 out.write(chByte);
 64                 // System.out.println(chByte);
 65                 chByte = in.read();
 66             }
 67         } catch (MalformedURLException e) {
 68             e.printStackTrace();
 69         } catch (IOException e) {
 70             e.printStackTrace();
 71         } finally {
 72             try {
 73                 out.close();
 74                 in.close();
 75                 httpConn.disconnect();
 76             } catch (Exception ex) {
 77                 ex.printStackTrace();
 78             }
 79         }
 80         // 涓嬭澆鎿嶄綔 - 緇撴潫
 81 
 82         // 鑾峰彇IP鎿嶄綔 - 寮濮?nbsp;: 浠庝復(fù)鏃舵枃浠禝P.shtml涓鍙朓P鍦板潃
 83         String IP = null;
 84         try {
 85             BufferedReader br = new BufferedReader(
 86                     new FileReader("tempSaveStr"));
 87             IP = br.readLine();
 88             br.close();
 89         } catch (Exception e) {
 90             e.printStackTrace();
 91         }
 92         // 鑾峰彇IP鎿嶄綔 - 緇撴潫
 93 
 94         // 鍒犻櫎鎿嶄綔 - 寮濮?nbsp;錛氬垹闄や復(fù)鏃舵枃浠禝P.shtml
 95         try {
 96             java.io.File myDelFile = new java.io.File("tempSaveStr");
 97             myDelFile.delete();
 98         } catch (Exception e) {
 99             System.out.println("Wrong Del");
100             e.printStackTrace();
101         }
102         // 鍒犻櫎鎿嶄綔 - 緇撴潫
103 
104         return IP;
105     }
106 }

      瀵逛簬婧愮爜涓55,56涓よ錛屾垜鏄緗負(fù)妯℃嫙IE涓嬭澆鐨勶紝鍙互閫氳繃淇敼錛岃揪鍒版ā鎷烣ireFox鐨勭洰鐨勶紝浠g爜濡備笅錛?br />
1 httpConn.setRequestProperty("User-Agent","Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14");



YeeYang 2009-05-19 23:35 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 久久久精品免费国产四虎| 亚洲AV永久无码精品水牛影视| 一级特黄aa毛片免费观看| 国产成人综合亚洲一区| 亚洲视屏在线观看| 亚洲精品你懂的在线观看| 免费看小12萝裸体视频国产| 91黑丝国产线观看免费| 四虎国产精品免费永久在线| 国产亚洲情侣久久精品| 亚洲欧洲无码AV不卡在线| 亚洲一区精品视频在线| 亚洲黄色免费电影| 亚洲2022国产成人精品无码区| 久久久无码精品亚洲日韩软件| 国产成人高清精品免费鸭子| 欧洲精品成人免费视频在线观看 | 3d成人免费动漫在线观看| 中文在线观看免费网站| 一级黄色毛片免费看| 免费精品久久久久久中文字幕| 亚洲av成人无码网站…| 亚洲精品美女久久久久久久| 91在线亚洲综合在线| 亚洲午夜一区二区三区| 亚洲人成图片网站| 2020年亚洲天天爽天天噜| 亚洲免费人成视频观看| 亚洲中文无码线在线观看| 亚洲性猛交xx乱| 亚洲婷婷在线视频| 91亚洲国产成人久久精品| 亚洲一卡2卡4卡5卡6卡在线99| 亚洲首页国产精品丝袜| 亚洲国产视频久久| 亚洲国产午夜精品理论片在线播放 | 亚洲国产中文字幕在线观看| 亚洲不卡无码av中文字幕| 免费a级黄色毛片| 亚洲国产一区明星换脸| 亚洲精品无码午夜福利中文字幕 |