??xml version="1.0" encoding="utf-8" standalone="yes"?>二区三区在线播放,欧美国产小视频,99色在线观看http://www.aygfsteel.com/gooogle/category/20962.html <a >3G视线论坛</a>zh-cnTue, 18 Sep 2007 03:02:53 GMTTue, 18 Sep 2007 03:02:53 GMT60JDK 6.0 API 中文?发布?/title><link>http://www.aygfsteel.com/gooogle/archive/2007/09/18/146097.html</link><dc:creator>爬虫工作?/dc:creator><author>爬虫工作?/author><pubDate>Tue, 18 Sep 2007 02:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/gooogle/archive/2007/09/18/146097.html</guid><wfw:comment>http://www.aygfsteel.com/gooogle/comments/146097.html</wfw:comment><comments>http://www.aygfsteel.com/gooogle/archive/2007/09/18/146097.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/gooogle/comments/commentRss/146097.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/gooogle/services/trackbacks/146097.html</trackback:ping><description><![CDATA[<h2>JDK 6.0 API 中文?/h2> <div class="wmqeeuq" id="postmessage_179" class="t_msgfont"><a target="_blank" class="l2">HTML ZIP打包<span onclick="tagshow(event)" class="t_tag">下蝲</span></a><br /> » <a target="_blank" class="l2">CHM 格式下蝲</a><br /> » <a target="_blank" class="l2">在线参?/a><br /> » <a target="_blank" class="l2">JDK 5.0 中文<span onclick="tagshow(event)" class="t_tag">API</span></a><br /> <br /> 来自:http://developers.sun.com.cn/home/sdnchina/home</div><img src ="http://www.aygfsteel.com/gooogle/aggbug/146097.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/gooogle/" target="_blank">爬虫工作?/a> 2007-09-18 10:56 <a href="http://www.aygfsteel.com/gooogle/archive/2007/09/18/146097.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于|站设计的一点点讨论http://www.aygfsteel.com/gooogle/archive/2007/05/19/118610.html爬虫工作?/dc:creator>爬虫工作?/author>Sat, 19 May 2007 15:48:00 GMThttp://www.aygfsteel.com/gooogle/archive/2007/05/19/118610.htmlhttp://www.aygfsteel.com/gooogle/comments/118610.htmlhttp://www.aygfsteel.com/gooogle/archive/2007/05/19/118610.html#Feedback4http://www.aygfsteel.com/gooogle/comments/commentRss/118610.htmlhttp://www.aygfsteel.com/gooogle/services/trackbacks/118610.html
首先明确了需要,q个我想是设计好一个项目的关键?br> 比如我们假像需求是q样子的Q我们再来谈谈,面对q样的需求,我们该怎么做?br> 需求如下:
1。会员问题,--- 要求|站的一些功能只提供l会员操作, 比如当用h览一个URL的时候,是需要会员权限的Q这样就产生了下面的需求,1。要求有自动跌{功能Q不是用户d了,或者是注册一个新用户Q这些操 作完成后都需要蟩转到前一ơ的操作。甚x跟前面的操作。这个功能到是容易实玎ͼ只需要记录用户前面几ơ操作的urlQ把他们入栈ok了,然后d或? 注册以后出?br> 2。资源保存问题, ---- 比如目l,要求Q用户上传,或者是后台上传的资源,必须保证其他目安全的,Ҏ操作的访问到?br> 比如Q管理h员在后台上传了一个图片。这个图片对于web来说可以讉KQ对于wap来说Q访问v来也是很L?- 不用在资源的路径加上|站的\径名。还有其他的{等?br> 3。数据库的设计, --- 自己q营的网站,对于数据库的安全性来说无疑是最高的? 我们现在采用的是mysqlQ现在用的是tomcat+spring+hibernateQ这样就会遇C个困难,比如设计金钱的数据,如果Ua的保存到 mysqlQ这样别ZR入到你web服务器的时候就可以获取你spring配置文g里面的数据密码等Q这样会造成数据泄露Q导致重大损失,q样D了就? 理q些数据的安全性变的很重要Q不应该直接暴露q些数据l程序,而是应该通过一些手D,比如只暴露存储过E,或者是暴露一些数据访问apil程序调用, q做虽然安全Q但设计h却是比较手。而且设计理那些数据的程序变的复杂,不能直接在tomcat讉K?br>
4。就是相对而已Q当你的E序E_以后Q我们就不应该再往q个目加上新功能,而是另外起一个项目,M是乱啊?br>

写到q里Q都不知道自己在写些什么了。哈

写这文章的时候,记录在blog上出了问题,后来那篇blog被我删除了,想不到在q里可以扑ֈ。真是不错,同时攑ֈ论坛跟blog好像是双保险


]]>
l上传图片加个图片水华ͼ文字水印的功?/title><link>http://www.aygfsteel.com/gooogle/archive/2007/05/16/117839.html</link><dc:creator>爬虫工作?/dc:creator><author>爬虫工作?/author><pubDate>Wed, 16 May 2007 06:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/gooogle/archive/2007/05/16/117839.html</guid><wfw:comment>http://www.aygfsteel.com/gooogle/comments/117839.html</wfw:comment><comments>http://www.aygfsteel.com/gooogle/archive/2007/05/16/117839.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/gooogle/comments/commentRss/117839.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/gooogle/services/trackbacks/117839.html</trackback:ping><description><![CDATA[     摘要: 关键? 企业应用             今天客户_他想把他上传的图片加上个水印的功能,以防止别人盗用他的图片。他认ؓ他的囄资料很重要。所以。。?好,客户有需求,我们满他Q以前我也比较少写操作图片的apiQ所以对囄加水印的功能也一直没接触Q不q对于现在网l来说。这...  <a href='http://www.aygfsteel.com/gooogle/archive/2007/05/16/117839.html'>阅读全文</a><img src ="http://www.aygfsteel.com/gooogle/aggbug/117839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/gooogle/" target="_blank">爬虫工作?/a> 2007-05-16 14:47 <a href="http://www.aygfsteel.com/gooogle/archive/2007/05/16/117839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于新闻发布pȝQ侧栏,与底栏的设计构想http://www.aygfsteel.com/gooogle/archive/2007/04/30/114700.html爬虫工作?/dc:creator>爬虫工作?/author>Mon, 30 Apr 2007 01:16:00 GMThttp://www.aygfsteel.com/gooogle/archive/2007/04/30/114700.htmlhttp://www.aygfsteel.com/gooogle/comments/114700.htmlhttp://www.aygfsteel.com/gooogle/archive/2007/04/30/114700.html#Feedback2http://www.aygfsteel.com/gooogle/comments/commentRss/114700.htmlhttp://www.aygfsteel.com/gooogle/services/trackbacks/114700.html




q几天也忙着开发这Lpȝ。曾l想q,直接生成一个全部静态的html。后来发玎ͼq样做不可行?br>原因Q?br>1.Ҏ上面的图片,我们可以知道一个模块应该尽量保持简单独立。相对于侧栏与底栏而言Q跟新闻内容可以说是靠不上边的,或许也是靠的很少?br>2.相对新闻内容来说。侧栏,底栏目相Ҏ说是动态的Q也是需要后台去处理。而前台展C的是动态展C,q样意味着Q前台文件不能全部包含静态html?br>3.相对开发而言。应该尽量保持简单,也就是说Q你发不新闻呢。只发布新闻内容可以了。其他的东西则有其他模块来做。这样做的好吃是Q修改,重构h是件很愉快的事情?br>
l过思考跟同事的意见。决定采用js的Ş式来做。js负责输出那些html。而js的生成则由后台去处理。这样大家的职责明昑֤了?br>至于前台展示吗。那也简单很多,直接引用q个jsok?br>如Ioc所说。你不要来找我。让我去找你p了?br>
大家也可以畅谈自己在开发这Ll的x?br>

 

]]>
解决HIbernate分页问题获取表总行数的Bughttp://www.aygfsteel.com/gooogle/archive/2007/04/30/114688.html爬虫工作?/dc:creator>爬虫工作?/author>Mon, 30 Apr 2007 00:46:00 GMThttp://www.aygfsteel.com/gooogle/archive/2007/04/30/114688.htmlhttp://www.aygfsteel.com/gooogle/comments/114688.htmlhttp://www.aygfsteel.com/gooogle/archive/2007/04/30/114688.html#Feedback0http://www.aygfsteel.com/gooogle/comments/commentRss/114688.htmlhttp://www.aygfsteel.com/gooogle/services/trackbacks/114688.html但同时在列出相关新闻的时候遇Cȝ。就是原本运行好好的分页查询代码Q居然有个小虫子跑出来,
很是令h不爽。说来也惭愧QHibernate也用了那么长旉了。可对底层API却很不属性?br>查了下网l,把自q一知半解说出来?br>
bugh?br>看看代码Q?br>
return (PageSupport) getHibernateTemplate().execute(
                new HibernateCallback() ...{
                    public Object doInHibernate(Session session)
                            throws HibernateException ...{
                        Criteria criteria = detachedCriteria
                                .getExecutableCriteria(session);
                     
                        
                        logger.debug("SQL: " + Projections.rowCount());
                        
                        
                         
                        //执行查询
                        int totalCount = ((Integer) criteria.setProjection(Projections.rowCount()).uniqueResult()).intValue();

                     
                     
                        
                        
                        List items = criteria.setFirstResult(startIndex)
                        .setMaxResults(pageSize).list();
                
                        PageSupport ps = new PageSupport(items, totalCount,
                                pageSize, startIndex);
                        
                        return ps;
                    }
                }, true);

怿大家对上面的代码也很熟悉了,q个代码W一ơ运行的时候没问题?br>{你LW?늚时候,提C出现NullPointer?发现?(Integer) criteria.setProjection(Projections.rowCount()).uniqueResult())为NullQ?也就是根本就拿不到表L?br>为此我思考了好一阵子?br>后来看了别h的代码才焕然大悟?br>看第2个代码:
return (PageSupport) getHibernateTemplate().execute(
                new HibernateCallback() ...{
                    public Object doInHibernate(Session session)
                            throws HibernateException ...{
                        Criteria criteria = detachedCriteria
                                .getExecutableCriteria(session);
                        
                        CriteriaImpl impl = (CriteriaImpl) criteria;

                        //先把Projection和OrderBy条g取出?清空两者来执行Count操作
                        Projection projection = impl.getProjection();
                        
                        logger.debug("SQL: " + Projections.rowCount());
                        
                        
                         
                        //执行查询
                        int totalCount = ((Integer) criteria.setProjection(Projections.rowCount()).uniqueResult()).intValue();

                        //之前的Projection和OrderBy条g重新讑֛?br>                        criteria.setProjection(projection);
                        if (projection == null) ...{
                            criteria.setResultTransformer(CriteriaSpecification.ROOT_ENTITY);
                        }
                     
                        
                        
                        List items = criteria.setFirstResult(startIndex)
                        .setMaxResults(pageSize).list();
                
                        PageSupport ps = new PageSupport(items, totalCount,
                                pageSize, startIndex);
                        
                        return ps;
                    }
                }, true);



]]>
角色的{? http://www.aygfsteel.com/gooogle/archive/2007/04/12/110067.html爬虫工作?/dc:creator>爬虫工作?/author>Thu, 12 Apr 2007 01:22:00 GMThttp://www.aygfsteel.com/gooogle/archive/2007/04/12/110067.htmlhttp://www.aygfsteel.com/gooogle/comments/110067.htmlhttp://www.aygfsteel.com/gooogle/archive/2007/04/12/110067.html#Feedback9http://www.aygfsteel.com/gooogle/comments/commentRss/110067.htmlhttp://www.aygfsteel.com/gooogle/services/trackbacks/110067.html
说实话把q么大的担子l我Q我压力大啊。我怿在这个论坛的很多牛h都有曾这Ll历Q可否给我一些徏议啊?br>
从一个编码设计到一个架构设计的转变需要经q些什么历l。高手们Q砸砖吧。^_^


]]>
自动注册gmail邮箱构想http://www.aygfsteel.com/gooogle/archive/2007/04/04/108408.html爬虫工作?/dc:creator>爬虫工作?/author>Wed, 04 Apr 2007 04:42:00 GMThttp://www.aygfsteel.com/gooogle/archive/2007/04/04/108408.htmlhttp://www.aygfsteel.com/gooogle/comments/108408.htmlhttp://www.aygfsteel.com/gooogle/archive/2007/04/04/108408.html#Feedback6http://www.aygfsteel.com/gooogle/comments/commentRss/108408.htmlhttp://www.aygfsteel.com/gooogle/services/trackbacks/108408.html阅读全文

]]>
d理解spring的定制Q务(schedulingQ?/title><link>http://www.aygfsteel.com/gooogle/archive/2007/04/01/107758.html</link><dc:creator>爬虫工作?/dc:creator><author>爬虫工作?/author><pubDate>Sun, 01 Apr 2007 07:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/gooogle/archive/2007/04/01/107758.html</guid><wfw:comment>http://www.aygfsteel.com/gooogle/comments/107758.html</wfw:comment><comments>http://www.aygfsteel.com/gooogle/archive/2007/04/01/107758.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/gooogle/comments/commentRss/107758.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/gooogle/services/trackbacks/107758.html</trackback:ping><description><![CDATA[     摘要: 关键? 企业应用           怿做Y件的朋友都有q样的经历,我的软g是不是少了点什么东西呢Q比如定时Q务啊Q?    拿新闻发布pȝ来说Q如果新ȝ数据更新太快Q势必涉及一个问题,q些新闻不能׃h工的d布,应该让系l自己发布,q就需要用到定时定制Q务了Q以?定制d无非是设计一个ThreadQƈ且设|运行时间片Q让它到了那个时间执?..  <a href='http://www.aygfsteel.com/gooogle/archive/2007/04/01/107758.html'>阅读全文</a><img src ="http://www.aygfsteel.com/gooogle/aggbug/107758.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/gooogle/" target="_blank">爬虫工作?/a> 2007-04-01 15:04 <a href="http://www.aygfsteel.com/gooogle/archive/2007/04/01/107758.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> 一个读取Gmail邮g的简单程?/title><link>http://www.aygfsteel.com/gooogle/archive/2007/03/30/107474.html</link><dc:creator>爬虫工作?/dc:creator><author>爬虫工作?/author><pubDate>Fri, 30 Mar 2007 06:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/gooogle/archive/2007/03/30/107474.html</guid><wfw:comment>http://www.aygfsteel.com/gooogle/comments/107474.html</wfw:comment><comments>http://www.aygfsteel.com/gooogle/archive/2007/03/30/107474.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.aygfsteel.com/gooogle/comments/commentRss/107474.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/gooogle/services/trackbacks/107474.html</trackback:ping><description><![CDATA[<div style="margin-left: 15px; margin-top: 5px;"> <b>关键?</b> 企业应用        </div>       兄弟我理论性的东西说不出来Q不q实际运用咱q是有办法的<br /> 前几天由于工作需要,想了解下关于支持ssl的邮件收发,按照以前普通的做法是行不通的Q所以就上网东找找,西瞧瞧。发C个好东西Qƈ且实验成功?<br />       那天本想来javaeye看看有没有h有相关的l验Q找了老半天,q个屁也没闻刎ͼ我就说我们,我们q些做程序员的不能老是吹吹_谈谈道理Q我们得拿出点实际的东西出来Q就想fins一P我就很佩服他的A献精?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, 0, 255);">package</span><span style="color: rgb(0, 0, 0);"> org.job.six;<br /><br /> <br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.UnsupportedEncodingException;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.security.Security;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.Properties;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.FetchProfile;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Folder;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Message;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Session;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Store;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.URLName;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.internet.InternetAddress;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.internet.MimeUtility;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.job.util.Logger;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.job.util.mail.ApplicationContext;<br /><br /></span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br /> * 用于收取Gmail邮g<br /> * <br /> * </span><span style="color: rgb(128, 128, 128);">@author</span><span style="color: rgb(0, 128, 0);"> wuhua<br /> </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /></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);"> GmailFetch {<br />    </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);">static</span><span style="color: rgb(0, 0, 0);"> Logger logger </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Logger.getLogger(GmailFetch.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />    </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);">static</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);"> main(String argv[]) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">开始读取邮?img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        Security.addProvider(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> com.sun.net.ssl.internal.ssl.Provider());<br />        </span><span style="color: rgb(0, 0, 255);">final</span><span style="color: rgb(0, 0, 0);"> String SSL_FACTORY </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);">javax.net.ssl.SSLSocketFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br /><br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> Get a Properties object</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        Properties props </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> System.getProperties();<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.socketFactory.class</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, SSL_FACTORY);<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.socketFactory.fallback</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);">false</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.port</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);">995</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.socketFactory.port</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);">995</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /><br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 以下步骤跟一般的JavaMail操作相同</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        Session session </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Session.getDefaultInstance(props, </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">);<br /><br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 请将U色部分对应替换成你的邮帐号和密码</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        URLName urln </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);"> URLName(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">pop3</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, ApplicationContext.POP3, </span><span style="color: rgb(0, 0, 0);">995</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 />                ApplicationContext.GMAIL_MAIL_NAME,<br />                ApplicationContext.GMAIL_MAIL_PASSWORD);<br />        Store store </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> session.getStore(urln);<br />        Folder inbox </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, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />            store.connect();<br />            inbox </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> store.getFolder(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">INBOX</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />            inbox.open(Folder.READ_ONLY);<br />            FetchProfile profile </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);"> FetchProfile();<br />            profile.add(FetchProfile.Item.ENVELOPE);<br />            Message[] messages </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> inbox.getMessages();<br />            inbox.fetch(messages, profile);<br />            logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">收gq邮g敎ͼ</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);"> messages.length);<br />            </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);"> messages.length; 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, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g发送?/span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                String from </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> decodeText(messages[i].getFrom()[</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">].toString());<br />                InternetAddress ia </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);"> InternetAddress(from);<br />                logger.debug(</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);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ia.getPersonal() </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);">(</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"><br />                        </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ia.getAddress() </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);">)</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">);<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g标题</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                logger.debug(</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);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> messages[i].getSubject());<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g大小</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">邮g大小:</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);"> messages[i].getSize());<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g发送时?/span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                logger.debug(</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);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> messages[i].getSentDate());<br />            }<br />        } </span><span style="color: rgb(0, 0, 255);">finally</span><span style="color: rgb(0, 0, 0);"> {<br />            </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                inbox.close(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">);<br />            } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            }<br />            </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                store.close();<br />            } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            }<br />        }<br />        <br />        logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">d邮g完毕<img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</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 decodeText(String text)<br />            </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> UnsupportedEncodingException {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (text </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, 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, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (text.startsWith(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">=?GB</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);"> text.startsWith(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">=?gb</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">))<br />            text </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> MimeUtility.decodeText(text);<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />            text </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);"> String(text.getBytes(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ISO8859_1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> text;<br />    }<br /><br />}<br /></span></div><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, 0, 255);">package</span><span style="color: rgb(0, 0, 0);"> org.job.six;<br /><br /> <br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.UnsupportedEncodingException;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.security.Security;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.Properties;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.FetchProfile;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Folder;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Message;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Session;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.Store;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.URLName;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.internet.InternetAddress;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.mail.internet.MimeUtility;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.job.util.Logger;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.job.util.mail.ApplicationContext;<br /><br /></span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br /> * 用于收取Gmail邮g<br /> * <br /> * </span><span style="color: rgb(128, 128, 128);">@author</span><span style="color: rgb(0, 128, 0);"> wuhua<br /> </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /></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);"> GmailFetch {<br />    </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);">static</span><span style="color: rgb(0, 0, 0);"> Logger logger </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Logger.getLogger(GmailFetch.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />    </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);">static</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);"> main(String argv[]) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">开始读取邮?img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        Security.addProvider(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> com.sun.net.ssl.internal.ssl.Provider());<br />        </span><span style="color: rgb(0, 0, 255);">final</span><span style="color: rgb(0, 0, 0);"> String SSL_FACTORY </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);">javax.net.ssl.SSLSocketFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br /><br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> Get a Properties object</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        Properties props </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> System.getProperties();<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.socketFactory.class</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, SSL_FACTORY);<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.socketFactory.fallback</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);">false</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.port</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);">995</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        props.setProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mail.pop3.socketFactory.port</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);">995</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /><br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 以下步骤跟一般的JavaMail操作相同</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        Session session </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Session.getDefaultInstance(props, </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">);<br /><br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 请将U色部分对应替换成你的邮帐号和密码</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        URLName urln </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);"> URLName(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">pop3</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, ApplicationContext.POP3, </span><span style="color: rgb(0, 0, 0);">995</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 />                ApplicationContext.GMAIL_MAIL_NAME,<br />                ApplicationContext.GMAIL_MAIL_PASSWORD);<br />        Store store </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> session.getStore(urln);<br />        Folder inbox </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, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />            store.connect();<br />            inbox </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> store.getFolder(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">INBOX</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />            inbox.open(Folder.READ_ONLY);<br />            FetchProfile profile </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);"> FetchProfile();<br />            profile.add(FetchProfile.Item.ENVELOPE);<br />            Message[] messages </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> inbox.getMessages();<br />            inbox.fetch(messages, profile);<br />            logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">收gq邮g敎ͼ</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);"> messages.length);<br />            </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);"> messages.length; 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, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g发送?/span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                String from </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> decodeText(messages[i].getFrom()[</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">].toString());<br />                InternetAddress ia </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);"> InternetAddress(from);<br />                logger.debug(</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);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ia.getPersonal() </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);">(</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"><br />                        </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ia.getAddress() </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);">)</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">);<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g标题</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                logger.debug(</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);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> messages[i].getSubject());<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g大小</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">邮g大小:</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);"> messages[i].getSize());<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> 邮g发送时?/span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                logger.debug(</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);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> messages[i].getSentDate());<br />            }<br />        } </span><span style="color: rgb(0, 0, 255);">finally</span><span style="color: rgb(0, 0, 0);"> {<br />            </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                inbox.close(</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">);<br />            } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            }<br />            </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                store.close();<br />            } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            }<br />        }<br />        <br />        logger.debug(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">d邮g完毕<img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    }<br /><br />    </span><span style="color: rgb(0, 0, 255);">protected</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 decodeText(String text)<br />            </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> UnsupportedEncodingException {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (text </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, 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, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (text.startsWith(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">=?GB</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);"> text.startsWith(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">=?gb</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">))<br />            text </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> MimeUtility.decodeText(text);<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />            text </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);"> String(text.getBytes(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ISO8859_1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> text;<br />    }<br /><br />}<br /><br /><br /></span></div> 上面代码Q完全可以封装成一个收取ssl邮g的库<br /> 改天有时间整理下关于发邮件的Ҏ<img src ="http://www.aygfsteel.com/gooogle/aggbug/107474.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/gooogle/" target="_blank">爬虫工作?/a> 2007-03-30 14:36 <a href="http://www.aygfsteel.com/gooogle/archive/2007/03/30/107474.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>怎么h本地的java源文Ӟ资源{提交到web服务器,不是手工?/title><link>http://www.aygfsteel.com/gooogle/archive/2007/03/06/105193.html</link><dc:creator>爬虫工作?/dc:creator><author>爬虫工作?/author><pubDate>Tue, 06 Mar 2007 06:19:00 GMT</pubDate><guid>http://www.aygfsteel.com/gooogle/archive/2007/03/06/105193.html</guid><wfw:comment>http://www.aygfsteel.com/gooogle/comments/105193.html</wfw:comment><comments>http://www.aygfsteel.com/gooogle/archive/2007/03/06/105193.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.aygfsteel.com/gooogle/comments/commentRss/105193.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/gooogle/services/trackbacks/105193.html</trackback:ping><description><![CDATA[<table width="100%"> <tbody> <tr> <td> <p>    q几天一直在忙着设计web目。公司刚刚买了一台测试服务器q来。以前没试服务器的时候,是把那些classes跟res{资源文件手工放到服务器QlinuxQ。以前没服务器的时候,是什么都在本机测试,mysqlQtomcat啊等。很是消耗资源,现在我想把这些用试服务器来做。但以前一直没有对自动提交资源文g的工兗纯手工很麻烦。看看各位兄弟有q方面的l验没有。给个build.xml的脚本参考下也行。这D|间比较懒Q不惛_搜烦了?/p> </td> </tr> </tbody> </table><img src ="http://www.aygfsteel.com/gooogle/aggbug/105193.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/gooogle/" target="_blank">爬虫工作?/a> 2007-03-06 14:19 <a href="http://www.aygfsteel.com/gooogle/archive/2007/03/06/105193.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>