<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>3xil3r&#039;s blog</title>
	<atom:link href="http://blog.tonice.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tonice.me</link>
	<description>on the way</description>
	<lastBuildDate>Sat, 24 Jul 2010 02:52:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>使用ncftp工具同步整个文件夹备份到FTP服务器</title>
		<link>http://blog.tonice.me/2010/07/22/use_ncftp_backup_to_ftp_server/</link>
		<comments>http://blog.tonice.me/2010/07/22/use_ncftp_backup_to_ftp_server/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 11:40:40 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[Linux Style]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=60</guid>
		<description><![CDATA[ncftpput -R -z -u user -p pass remotehost /remote_directory /local_directory 同步整个目录 -R 递归同步 -z 是否断点续传 /remote_directory FTP上面的路径 /local_directory 要备份的路径 ncftp 下载 配合上次发的Dreamhost空间单用户多网站备份脚本，可以完美的达到备份的目的。]]></description>
			<content:encoded><![CDATA[<div>ncftpput -R -z -u user -p pass remotehost /remote_directory /local_directory 同步整个目录</div>
<div>-R 递归同步</div>
<div>-z 是否断点续传</div>
<div>/remote_directory FTP上面的路径</div>
<div>/local_directory 要备份的路径</div>
<div><a href="http://www.ncftp.com/download/" target="_blank">ncftp 下载</a></div>
<div>配合上次发的<a title="Dreamhost空间单用户多网站备份脚本" rel="bookmark" href="http://blog.tonice.me/2010/06/30/dreamhost_auto_backup_bash_shell/">Dreamhost空间单用户多网站备份脚本</a>，可以完美的达到备份的目的。</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2010/07/22/use_ncftp_backup_to_ftp_server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>爱名网http://www.22.cn域名转移苦难记</title>
		<link>http://blog.tonice.me/2010/07/13/angry_about_domain_transfer_on_22-cn/</link>
		<comments>http://blog.tonice.me/2010/07/13/angry_about_domain_transfer_on_22-cn/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 13:17:30 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[网络相关]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=50</guid>
		<description><![CDATA[爱名网http://www.22.cn域名转移苦难记  07-12从朋友那在爱名网转购买了一个比较好的域名,然后想想转移到国外比较好，就尝试了转移，但是爱名网的系统需要身份验证，我提交了身份证验证，等了一天还是没有通过 07-13联系了客服，说是我身份证没在什么公安部验证过不能通过啥的，我表示严重怀疑是爱名网http://www.22.cn为了不让我转出那个比较好的域名的借口，我的身份证信息在 银行办卡啥的根本没有问题。  后来从网络上看到ICANN投诉,尝试了投诉，正在等待回复。  从网上找到爱名网的一些信息，真是恶名连连，请看连接。   1.网上域名购买服务如何投诉？关于爱名网(22.cn)的 !   2.22.cn网站中文域名非法违规不存在续费期，要求1000高价赎回!   建议各位朋友不要去爱名网http://www.22.cn进行交易。  2010-07-14最新情况 请注意，他们7-13就借口说找不到身份证数据]]></description>
			<content:encoded><![CDATA[<p>爱名网<a href="http://www.22.cn/">http://www.22.cn</a>域名转移苦难记</p>
<p> 07-12从朋友那在爱名网转购买了一个比较好的域名,然后想想转移到国外比较好，就尝试了转移，但是爱名网的系统需要身份验证，我提交了身份证验证，等了一天还是没有通过<br />
07-13联系了客服，说是我身份证没在什么公安部验证过不能通过啥的，我表示严重怀疑是爱名网<a href="http://www.22.cn/">http://www.22.cn</a>为了不让我转出那个比较好的域名的借口，我的身份证信息在<br />
银行办卡啥的根本没有问题。<br />
 后来从网络上看到ICANN投诉,尝试了投诉，正在等待回复。</p>
<p> 从网上找到爱名网的一些信息，真是恶名连连，请看连接。</p>
<p>  1.<a href="http://zhidao.baidu.com/question/142319027" target="_blank">网上域名购买服务如何投诉？关于爱名网(22.cn)的</a> !</p>
<p>  2.<a href="http://www.315ts.net/archive/tousu/2010/0629/770861.shtml" target="_blank">22.cn网站中文域名非法违规不存在续费期，要求1000高价赎回</a>!</p>
<p>  建议各位朋友不要去爱名网<a href="http://www.22.cn/">http://www.22.cn</a>进行交易。</p>
<p> 2010-07-14最新情况</p>
<p><strong>请注意，他们7-13就借口说找不到身份证数据</strong><br />
<a href="http://blog.tonice.me/wp-content/uploads/2010/07/1.jpg"><img class="size-medium wp-image-57 alignleft" title="爱名网赖皮记" src="http://blog.tonice.me/wp-content/uploads/2010/07/1.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2010/07/13/angry_about_domain_transfer_on_22-cn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dreamhost空间单用户多网站备份脚本</title>
		<link>http://blog.tonice.me/2010/06/30/dreamhost_auto_backup_bash_shell/</link>
		<comments>http://blog.tonice.me/2010/06/30/dreamhost_auto_backup_bash_shell/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 15:47:25 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[Linux Style]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=47</guid>
		<description><![CDATA[代码如下,未测试 有任何建议请和我联系 部份程序参考 http://www.icnote.com/DreamHost-Auto-back-up/ Bash语言: Codee#11847 #工具信息 TAR=`which tar` MYSQLDUMP=`which mysqldump` #网站信息 SiteRoot=/home/icnote/ SITE=(&#8216;site1&#8242; &#8216;site2&#8242; &#8216;site3&#8242;) #DB INFo DBNames=(&#8216;dbname1&#8242; &#8216;dbname2&#8242; &#8216;dbname3&#8242;) #数据库名 DBUsers=(&#8216;username1&#8242; &#8216;username2&#8242; &#8216;username3&#8242;)  #数据库用户名 DBPasswds=(&#8217;1&#8242; &#8217;2&#8242; &#8217;3&#8242;)  #数据库密码 DBHosts=(&#8216;host1&#8242; &#8216;host2&#8242; &#8216;host3&#8242;) #数据库地址 DBCharsets=(&#8216;utf8&#8242; &#8216;utf8&#8242; &#8216;utf8&#8242;) #路径 BackupPath=/home/hexuzhong/backup/$(date +%y%m%d)/ # 备份文件存放目录 if [ -d $BackupPath ] then   rm -rf &#8220;$BackupPath&#8221;* else   mkdir [...]]]></description>
			<content:encoded><![CDATA[<p>代码如下,未测试</p>
<p>有任何建议请和我联系</p>
<p>部份程序参考 <a href="http://www.icnote.com/DreamHost-Auto-back-up/">http://www.icnote.com/DreamHost-Auto-back-up/</a></p>
<div style="BACKGROUND: #fdfdfd; COLOR: black"><span style="text-decoration: underline;">Bash语言</span>: <a href="http://fayaa.com/code/view/11847/">Codee#11847</a></div>
<div class="source" style="BACKGROUND-COLOR: #000029; FONT-FAMILY: 'None','Consolas','Lucida Console','Courier New'; COLOR: #9fb6cd"><span style="COLOR: #66cd00">#工具信息</span><br />
<span style="COLOR: #9fb6cd">TAR</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #cd5555">`</span><span style="COLOR: #9fb6cd">which tar</span><span style="COLOR: #cd5555">`</span><br />
<span style="COLOR: #9fb6cd">MYSQLDUMP</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #cd5555">`</span><span style="COLOR: #9fb6cd">which mysqldump</span><span style="COLOR: #cd5555">`</span></p>
<p><span style="COLOR: #66cd00">#网站信息</span><br />
<span style="COLOR: #9fb6cd">SiteRoot</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #9fb6cd">/home/icnote/</span><br />
<span style="COLOR: #9fb6cd">SITE</span><span style="COLOR: #9fb6cd">=(</span><span style="COLOR: #cd5555">&#8216;site1&#8242;</span> <span style="COLOR: #cd5555">&#8216;site2&#8242;</span> <span style="COLOR: #cd5555">&#8216;site3&#8242;</span>)<br />
<span style="COLOR: #66cd00">#DB INFo</span><br />
<span style="COLOR: #9fb6cd">DBNames</span><span style="COLOR: #9fb6cd">=(</span><span style="COLOR: #cd5555">&#8216;dbname1&#8242;</span> <span style="COLOR: #cd5555">&#8216;dbname2&#8242;</span> <span style="COLOR: #cd5555">&#8216;dbname3&#8242;</span>) <span style="COLOR: #66cd00">#数据库名</span><br />
<span style="COLOR: #9fb6cd">DBUsers</span><span style="COLOR: #9fb6cd">=(</span><span style="COLOR: #cd5555">&#8216;username1&#8242;</span> <span style="COLOR: #cd5555">&#8216;username2&#8242;</span> <span style="COLOR: #cd5555">&#8216;username3&#8242;</span>)  <span style="COLOR: #66cd00">#数据库用户名</span><br />
<span style="COLOR: #9fb6cd">DBPasswds</span><span style="COLOR: #9fb6cd">=(</span><span style="COLOR: #cd5555">&#8217;1&#8242;</span> <span style="COLOR: #cd5555">&#8217;2&#8242;</span> <span style="COLOR: #cd5555">&#8217;3&#8242;</span>)  <span style="COLOR: #66cd00">#数据库密码</span><br />
<span style="COLOR: #9fb6cd">DBHosts</span><span style="COLOR: #9fb6cd">=(</span><span style="COLOR: #cd5555">&#8216;host1&#8242;</span> <span style="COLOR: #cd5555">&#8216;host2&#8242;</span> <span style="COLOR: #cd5555">&#8216;host3&#8242;</span>) <span style="COLOR: #66cd00">#数据库地址</span><br />
<span style="COLOR: #9fb6cd">DBCharsets</span><span style="COLOR: #9fb6cd">=(</span><span style="COLOR: #cd5555">&#8216;utf8&#8242;</span> <span style="COLOR: #cd5555">&#8216;utf8&#8242;</span> <span style="COLOR: #cd5555">&#8216;utf8&#8242;</span>)</p>
<p><span style="COLOR: #66cd00">#路径</span><br />
<span style="COLOR: #9fb6cd">BackupPath</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #9fb6cd">/home/hexuzhong/backup/</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">$(</span><span style="COLOR: #9fb6cd">date +%y%m%d</span>)<span style="COLOR: #9fb6cd">/</span><br />
<span style="COLOR: #66cd00"># 备份文件存放目录</span><br />
<span style="color: #cdc673; font-weight: bold; text-decoration: underline;">if</span> <span style="COLOR: #9fb6cd">[</span><span style="COLOR: #9fb6cd"> -d </span><span style="COLOR: #9fb6cd">$BackupPath</span> <span style="COLOR: #9fb6cd">]</span><br />
<span style="color: #cdc673; font-weight: bold; text-decoration: underline;">then</span><br />
  <span style="COLOR: #9fb6cd">rm -rf </span><span style="COLOR: #cd5555">&#8220;$BackupPath&#8221;</span><span style="COLOR: #9fb6cd">*</span><br />
<span style="color: #cdc673; font-weight: bold; text-decoration: underline;">else</span><br />
  <span style="COLOR: #9fb6cd">mkdir </span><span style="COLOR: #9fb6cd">$BackupPath</span><br />
<span style="COLOR: #9fb6cd">  chmod 755 </span><span style="COLOR: #9fb6cd">$BackupPath</span><span style="COLOR: #9fb6cd"> -R</span><br />
<span style="color: #cdc673; font-weight: bold; text-decoration: underline;">fi</span><br />
<span style="COLOR: #9fb6cd">LogFile</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #cd5555">&#8220;$BackupPath&#8221;</span><span style="COLOR: #9fb6cd">backUp.log</span></p>
<p><span style="COLOR: #9fb6cd">numvalues</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${#</span><span style="COLOR: #9fb6cd">SITE</span><span style="COLOR: #9fb6cd">[@]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span><br />
<span style="color: #cdc673; font-weight: bold; text-decoration: underline;">for</span> (( <span style="COLOR: #9fb6cd">i</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #9fb6cd">1; i &lt; numvalues; i++ </span>)); <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">do</span><br />
   <br />
    <span style="COLOR: #9fb6cd">domain</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${</span><span style="COLOR: #9fb6cd">SITE</span><span style="COLOR: #9fb6cd">[i]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span><br />
    <span style="COLOR: #9fb6cd">cd</span> <span style="COLOR: #9fb6cd">$BackupPath</span><br />
    <span style="COLOR: #66cd00">##路径信息</span><br />
    <span style="COLOR: #9fb6cd">SiteDir</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #9fb6cd">$SiteRoot$domain</span><br />
    <span style="COLOR: #9fb6cd">TempSqlFileName</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #cd5555">&#8220;$BackupPath$domain&#8221;</span><span style="COLOR: #9fb6cd">tempSQL.sql</span><br />
    <span style="COLOR: #9fb6cd">SiteBackUpName</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #cd5555">&#8220;$BackupPath$domain&#8221;</span><span style="COLOR: #9fb6cd">web</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">$(</span><span style="COLOR: #9fb6cd">date +%y%m%d</span>)<span style="COLOR: #9fb6cd">.tar.gz</span><br />
    <span style="COLOR: #9fb6cd">DBDumpFileName</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #cd5555">&#8220;$BackupPath$domain&#8221;</span><span style="COLOR: #9fb6cd">db</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">$(</span><span style="COLOR: #9fb6cd">date +%y%m%d</span>)<span style="COLOR: #9fb6cd">.sql.tar.gz</span></p>
<p>    <span style="COLOR: #66cd00">###数据库信息###</span><br />
    <span style="COLOR: #9fb6cd">DBHost</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${</span><span style="COLOR: #9fb6cd">DBHosts</span><span style="COLOR: #9fb6cd">[i]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span><br />
    <span style="COLOR: #9fb6cd">DBUser</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${</span><span style="COLOR: #9fb6cd">DBUsers</span><span style="COLOR: #9fb6cd">[i]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span><br />
    <span style="COLOR: #9fb6cd">DBPasswd</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${</span><span style="COLOR: #9fb6cd">DBPasswds</span><span style="COLOR: #9fb6cd">[i]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span><br />
    <span style="COLOR: #9fb6cd">DBName</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${</span><span style="COLOR: #9fb6cd">DBNames</span><span style="COLOR: #9fb6cd">[i]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span><br />
    <span style="COLOR: #9fb6cd">DBCharset</span><span style="COLOR: #9fb6cd">=</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">${</span><span style="COLOR: #9fb6cd">DBCharsets</span><span style="COLOR: #9fb6cd">[i]</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">}</span></p>
<p>    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">$(</span><span style="COLOR: #9fb6cd">date +</span><span style="COLOR: #cd5555">&#8220;%y-%m-%d %H:%M:%S&#8221;</span>)<span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;Site $domain back up start&#8230;&#8230;&#8230;&#8230;.&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;Web $domain files back up start&#8230;&#8230;&#8230;&#8230;.&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span></p>
<p>    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">if</span> <span style="COLOR: #9fb6cd">[</span><span style="COLOR: #9fb6cd"> -f </span><span style="COLOR: #9fb6cd">$SiteBackUpName</span> <span style="COLOR: #9fb6cd">]</span><br />
    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">then </span><br />
      <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;[$SiteBackUpName]The Backup File is exists,Can&#8217;t Backup!&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">else</span><br />
      <span style="COLOR: #9fb6cd">$TAR</span><span style="COLOR: #9fb6cd"> czvf </span><span style="COLOR: #9fb6cd">$SiteBackUpName</span> <span style="COLOR: #9fb6cd">$SiteDir</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
      <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;[$SiteBackUpName]Backup Success!&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">fi</span></p>
<p>    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;Web files back up finished!&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;Now database dump start&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span></p>
<p>    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">if</span> <span style="COLOR: #9fb6cd">[</span><span style="COLOR: #9fb6cd"> -f </span><span style="COLOR: #9fb6cd">$DBDumpFileName</span> <span style="COLOR: #9fb6cd">]</span><br />
    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">then </span><br />
      <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;[$DBDumpFileName]The Backup File is exists,Can&#8217;t Backup!&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">else</span><br />
      <span style="COLOR: #9fb6cd">$MYSQLDUMP</span><span style="COLOR: #9fb6cd"> -h</span><span style="COLOR: #9fb6cd">$DBHost</span><span style="COLOR: #9fb6cd"> -u</span><span style="COLOR: #9fb6cd">$DBUser</span><span style="COLOR: #9fb6cd"> -p</span><span style="COLOR: #9fb6cd">$DBPasswd</span><span style="COLOR: #9fb6cd"> &#8211;default-character-set</span><span style="COLOR: #9fb6cd">=</span><span style="COLOR: #9fb6cd">$DBCharset</span><span style="COLOR: #9fb6cd"> &#8211;opt </span><span style="COLOR: #9fb6cd">$DBName</span><span style="COLOR: #9fb6cd"> &gt; </span><span style="COLOR: #9fb6cd">$TempSqlFileName</span><br />
      <span style="COLOR: #9fb6cd">$TAR</span><span style="COLOR: #9fb6cd"> czvf </span><span style="COLOR: #9fb6cd">$DBDumpFileName</span> <span style="COLOR: #9fb6cd">$TempSqlFileName</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
<span style="COLOR: #9fb6cd">      rm -rf </span><span style="COLOR: #9fb6cd">$TempSqlFileName</span><br />
      <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;[$DBDumpFileName] Backup Success!&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="color: #cdc673; font-weight: bold; text-decoration: underline;">fi</span></p>
<p>    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;Now database dump finished!&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;The whole backup task completed at &#8220;</span><span style="color: #cdc673; font-weight: bold; text-decoration: underline;">$(</span><span style="COLOR: #9fb6cd">date +</span><span style="COLOR: #cd5555">&#8220;%y-%m-%d %H:%M:%S&#8221;</span>)<span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
    <span style="COLOR: #9fb6cd">echo</span> <span style="COLOR: #cd5555">&#8220;########################################&#8221;</span><span style="COLOR: #9fb6cd"> &gt;&gt; </span><span style="COLOR: #9fb6cd">$LogFile</span><br />
<span style="color: #cdc673; font-weight: bold; text-decoration: underline;">done</span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2010/06/30/dreamhost_auto_backup_bash_shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>君呦，花呦</title>
		<link>http://blog.tonice.me/2010/06/03/%e5%90%9b%e5%91%a6%ef%bc%8c%e8%8a%b1%e5%91%a6/</link>
		<comments>http://blog.tonice.me/2010/06/03/%e5%90%9b%e5%91%a6%ef%bc%8c%e8%8a%b1%e5%91%a6/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 14:14:26 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[靡靡之音]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=42</guid>
		<description><![CDATA[花的生命 　　是如此短暂 　　梦想的岁月 　　飞逝而过 　　残酷的时间哟 　　毫无悲悯之心 　　然而在我心中骄傲绽放的 　　正是你与那些花儿……]]></description>
			<content:encoded><![CDATA[<p>     花的生命<br />
　　是如此短暂<br />
　　梦想的岁月<br />
　　飞逝而过<br />
　　残酷的时间哟<br />
　　毫无悲悯之心<br />
　　然而在我心中骄傲绽放的<br />
　　正是你与那些花儿……<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.tudou.com/v/uqBpiPRcLNg/v.swf" /><param name="wmode" value="opaque" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://www.tudou.com/v/uqBpiPRcLNg/v.swf" allowfullscreen="true" wmode="opaque"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2010/06/03/%e5%90%9b%e5%91%a6%ef%bc%8c%e8%8a%b1%e5%91%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>支持右键添加目录到Windows环境变量path变量中并立即生效的小工具</title>
		<link>http://blog.tonice.me/2010/06/02/windows_path_toolkit/</link>
		<comments>http://blog.tonice.me/2010/06/02/windows_path_toolkit/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 15:55:21 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[流光飞绪]]></category>
		<category><![CDATA[indows环境变量小工具]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=36</guid>
		<description><![CDATA[使用说明: 1.不需要安装, 将下载后解压缩，将解压缩后的目录拷贝到你喜欢的路径下即可。 2.第一次使用编辑&#8221;添加到系统路径.reg&#8221;文件，将I:\\mydoc\\pathTool.exe改成您的pathTool.exe的路径，请注意要双左斜线。 3.以后只要在目录上面点击右键, 就会看到&#8221;Add To Path&#8221;菜单项, 点击执行, 则选择的目录会自动加入到path环境变量中。 4.为了使path环境变量立即生效，程序向系统发送了广播消息，因此要延时几十秒钟，请耐心等待一下。 @使用备注: 环境变量分为用户环境变量和系统环境变量，用户环境变量只对当前用户有效，系统环境变量对于系统中的所有用户有效。 本程序修改的是用户环境变量中的path变量。同一个目录不会重复加入，程序会自动处理。 @关于程序修改Windows环境变量后使环境变量立即生效的问题: 本程序是使用SendMessageTimeout函数向系统发送设置改变的消息来实现的。具体代码如下: DWORD dwMsgResult = 0L; SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,LPARAM(&#8220;Environment&#8221;), SMTO_ABORTIFHUNG, 5000, &#38;dwMsgResult); 5000是延时等待的时间长度，单位为毫秒。整个等待的长度为: Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows. 在本示例中整个程序等待的长度 = 5000 * 顶层窗口的个数; 实现原理 查询注册表path的值，如果路径已存在提示已存在，如果不存在的话添加到path，然后SendMessageTimeout让环境变量起作用。 DWORD [...]]]></description>
			<content:encoded><![CDATA[<p>使用说明:</p>
<p>1.不需要安装, 将下载后解压缩，将解压缩后的目录拷贝到你喜欢的路径下即可。<br />
2.第一次使用编辑&#8221;添加到系统路径.reg&#8221;文件，将I:\\mydoc\\pathTool.exe改成您的pathTool.exe的路径，请注意要双左斜线。<br />
3.以后只要在目录上面点击右键, 就会看到&#8221;Add To Path&#8221;菜单项, 点击执行, 则选择的目录会自动加入到path环境变量中。<br />
4.为了使path环境变量立即生效，程序向系统发送了广播消息，因此要延时几十秒钟，请耐心等待一下。</p>
<p>@使用备注:</p>
<p>环境变量分为用户环境变量和系统环境变量，用户环境变量只对当前用户有效，系统环境变量对于系统中的所有用户有效。 本程序修改的是用户环境变量中的path变量。同一个目录不会重复加入，程序会自动处理。</p>
<p>@关于程序修改Windows环境变量后使环境变量立即生效的问题:</p>
<p>本程序是使用SendMessageTimeout函数向系统发送设置改变的消息来实现的。具体代码如下:</p>
<p>DWORD dwMsgResult = 0L;</p>
<p>SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,LPARAM(&#8220;Environment&#8221;), SMTO_ABORTIFHUNG, 5000, &amp;dwMsgResult);</p>
<p>5000是延时等待的时间长度，单位为毫秒。整个等待的长度为:</p>
<p>Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows.</p>
<p>在本示例中整个程序等待的长度 = 5000 * 顶层窗口的个数;</p>
<p><strong>实现原理</strong></p>
<p>查询注册表path的值，如果路径已存在提示已存在，如果不存在的话添加到path，然后SendMessageTimeout让环境变量起作用。</p>
<p>DWORD dwMsgResult = 0L;<br />
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,LPARAM(&#8220;Environment&#8221;), SMTO_ABORTIFHUNG, 5000, &amp;dwMsgResult);//广播让系统路径起作用</p>
<p>下载<a href="http://www.rayfile.com/files/6a3f351c-0b50-11df-bee6-0015c55db73d/" target="_blank">pathTool.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2010/06/02/windows_path_toolkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu9.10安装go编译器备忘</title>
		<link>http://blog.tonice.me/2010/01/23/install_go_compiler_on_ubuntu/</link>
		<comments>http://blog.tonice.me/2010/01/23/install_go_compiler_on_ubuntu/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 12:10:18 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[GO Lang]]></category>
		<category><![CDATA[go compiler]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=33</guid>
		<description><![CDATA[参考go语言官网教程并作相应的修改等 参考地址http://golang.org/doc/install.html 1.在~目录的.bash_profile设置相关的环境变量 $GOROOT 根目录。 $GOARCH 操作系统的架构，有以下可选 amd64 (64-bit x86, the most mature port), 386(32-bit x86), and arm(32-bit ARM, an incomplete port。 $GOBIN bin目录，官网上提示是可选的，但是在我的编译过程会提示缺少GOBIN目录。 以下是我的.bash_profile文件内容 export GOROOT=$HOME/go export GOARCH=386 export GOOS=linux export GOBIN=$HOME/bin 保存为用以下命令检查是否生效。 $ env &#124; grep &#8216;^GO&#8217; 2.从GO源码库下载源文件，进行编译 GO源码库使用的是Mercurial管理系统，需要安装相应的程序hg。 如果在您的机器上没有hg命令的话，请按照以下步骤进行安装 $ sudo easy_install mercurial  如果您的系统提示没有easy_install命令，请先运行apt-get install python-setuptools python-dev安装。 接下来我们将源码导出到$GOROOT目录（请确保$GOROOT目录存在） $ hg clone -r [...]]]></description>
			<content:encoded><![CDATA[<p>参考go语言官网教程并作相应的修改等</p>
<p>参考地址<a href="http://golang.org/doc/install.html" target="_blank">http://golang.org/doc/install.html</a></p>
<p><strong>1.在~目录的.bash_profile设置相关的环境变量</strong></p>
<dl>
<dt>$GOROOT 根目录。 </dt>
</dl>
<p>$GOARCH 操作系统的架构，有以下可选 amd64 (64-bit x86, the most mature port), 386(32-bit  x86), and arm(32-bit ARM, an incomplete port。</p>
<p>$GOBIN bin目录，官网上提示是可选的，但是在我的编译过程会提示缺少GOBIN目录。</p>
<p>以下是我的.bash_profile文件内容</p>
<p>export GOROOT=$HOME/go</p>
<p>export GOARCH=386</p>
<p>export GOOS=linux</p>
<p>export GOBIN=$HOME/bin</p>
<p>保存为用以下命令检查是否生效。</p>
<p>$ env | grep &#8216;^GO&#8217;</p>
<p><strong>2.从GO源码库下载源文件，进行编译</strong></p>
<p>GO源码库使用的是Mercurial管理系统，需要安装相应的程序<em>hg。</em></p>
<p>如果在您的机器上没有hg命令的话，请按照以下步骤进行安装</p>
<p>$ sudo easy_install mercurial  <em>如果您的系统提示没有easy_install命令，请先运行</em>apt-get install python-setuptools python-dev<em>安装。</em></p>
<p>接下来我们将源码导出到$GOROOT目录（<em>请确保</em>$GOROOT<em>目录存在</em>）</p>
<p>$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT</p>
<p><strong>3.开始编译</strong></p>
<p>编译源码需要gcc等，如果您的系统没有gcc相关，请运行</p>
<p>$ sudo apt-get install bison gcc libc6-dev ed make</p>
<p>接着输入</p>
<p>$ cd $GOROOT/src</p>
<p>$ make all</p>
<p>正式进行编译工作，接着可以看会电视休息会了 XD</p>
<p>&#8230;N分钟后</p>
<p>如果提示</p>
<p>&#8212; cd ../test</p>
<p>0 known bugs; 0 unexpected bugs</p>
<p>就是<strong>编译成功了</strong></p>
<p><strong>4.使用编译器编译go语言</strong></p>
<p>请到go官网查看编译器和连接器怎么使用</p>
<p><strong>5.保持编译器最新</strong></p>
<p>如果编译器有更新的话，可以使用以下命令进行更新编译</p>
<p>$ cd $GOROOT/src</p>
<p>$ hg pull</p>
<p>$ hg update release</p>
<p>$ make all</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2010/01/23/install_go_compiler_on_ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>恶心的strtok的实现</title>
		<link>http://blog.tonice.me/2009/09/29/how_sick_my_c_programm/</link>
		<comments>http://blog.tonice.me/2009/09/29/how_sick_my_c_programm/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 13:51:26 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[Linux Style]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=26</guid>
		<description><![CDATA[留此为鉴 C语言: Codee#6730 01 #include &#60;stdio.h&#62; 02 #include &#60;stdlib.h&#62; 03 #include &#60;string.h&#62; 04 05 char *mystrtok(char *str, const char *delim); 06 07 int main(void) { 08 09         char str[] = &#8220;root:x::0:root:/root:/bin/bash:&#8221;; 10         char *token; 11 12         token = mystrtok(str, &#8220;:&#8221;); 13         printf(&#8220;%s\n&#8220;, token); 14         while ( (token = mystrtok(NULL, &#8220;:&#8221;)) [...]]]></description>
			<content:encoded><![CDATA[<p>留此为鉴</p>
<div style="BACKGROUND: #fdfdfd; COLOR: black"><span style="text-decoration: underline;">C语言</span>: <a href="http://fayaa.com/code/view/6730/">Codee#6730</a></div>
<div class="source" style="BACKGROUND-COLOR: #000000; FONT-FAMILY: 'None','Consolas','Lucida Console','Courier New'; COLOR: #c0c0c0"><span style="COLOR: #696969">01</span> <span style="COLOR: #ffffff">#include &lt;stdio.h&gt;</span><br />
<span style="COLOR: #696969">02</span> <span style="COLOR: #ffffff">#include &lt;stdlib.h&gt;</span><br />
<span style="COLOR: #696969">03</span> <span style="COLOR: #ffffff">#include &lt;string.h&gt;</span><br />
<span style="COLOR: #696969">04</span><br />
<span style="COLOR: #f810b0">05</span> <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">mystrtok</span>(<span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #00ffff; FONT-WEIGHT: bold">const</span> <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">delim</span>);<br />
<span style="COLOR: #696969">06</span><br />
<span style="COLOR: #696969">07</span> <span style="COLOR: #ffffff">int</span> <span style="COLOR: #00ffff">main</span>(<span style="COLOR: #ffffff">void</span>) <span style="COLOR: #c0c0c0">{</span><br />
<span style="COLOR: #696969">08</span><br />
<span style="COLOR: #696969">09</span>         <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">[]</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #00bbbb">&#8220;root:x::0:root:/root:/bin/bash:&#8221;</span>;<br />
<span style="COLOR: #f810b0">10</span>         <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">token</span>;<br />
<span style="COLOR: #696969">11</span><br />
<span style="COLOR: #696969">12</span>         <span style="COLOR: #c0c0c0">token</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #c0c0c0">mystrtok</span>(<span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #00bbbb">&#8220;:&#8221;</span>);<br />
<span style="COLOR: #696969">13</span>         <span style="COLOR: #c0c0c0">printf</span>(<span style="COLOR: #00bbbb">&#8220;%s</span><span style="COLOR: #00bbbb">\n</span><span style="COLOR: #00bbbb">&#8220;</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #c0c0c0">token</span>);<br />
<span style="COLOR: #696969">14</span>         <span style="COLOR: #00ffff; FONT-WEIGHT: bold">while</span> ( (<span style="COLOR: #c0c0c0">token</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #c0c0c0">mystrtok</span>(<span style="COLOR: #c0c0c0">NULL</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #00bbbb">&#8220;:&#8221;</span>)) <span style="COLOR: #c0c0c0">!=</span> <span style="COLOR: #c0c0c0">NULL</span>)<br />
<span style="COLOR: #f810b0">15</span>                 <span style="COLOR: #c0c0c0">printf</span>(<span style="COLOR: #00bbbb">&#8220;%s</span><span style="COLOR: #00bbbb">\n</span><span style="COLOR: #00bbbb">&#8220;</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #c0c0c0">token</span>);<br />
<span style="COLOR: #696969">16</span><br />
<span style="COLOR: #696969">17</span>         <span style="COLOR: #c0c0c0">free</span>(<span style="COLOR: #c0c0c0">token</span>);<br />
<span style="COLOR: #696969">18</span>         <span style="COLOR: #00ffff; FONT-WEIGHT: bold">return</span> <span style="COLOR: #c0c0c0">0</span>;<br />
<span style="COLOR: #696969">19</span> <span style="COLOR: #c0c0c0">}</span><br />
<span style="COLOR: #f810b0">20</span> <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #00ffff">mystrtok</span>(<span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #00ffff; FONT-WEIGHT: bold">const</span> <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">delim</span>) <span style="COLOR: #c0c0c0">{</span><br />
<span style="COLOR: #696969">21</span><br />
<span style="COLOR: #696969">22</span>         <span style="COLOR: #00ffff; FONT-WEIGHT: bold">static</span> <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">last</span>;<br />
<span style="COLOR: #696969">23</span>         <span style="COLOR: #ffffff">char</span> <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">t</span>;<br />
<span style="COLOR: #696969">24</span>         <span style="COLOR: #ffffff">int</span> <span style="COLOR: #c0c0c0">i</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #c0c0c0">0</span>;<br />
<span style="COLOR: #f810b0">25</span><br />
<span style="COLOR: #696969">26</span>         <span style="COLOR: #00ffff; FONT-WEIGHT: bold">if</span> ((<span style="COLOR: #c0c0c0">NULL</span> <span style="COLOR: #c0c0c0">==</span> <span style="COLOR: #c0c0c0">str</span>) <span style="COLOR: #c0c0c0">&amp;&amp;</span> ((<span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">=</span><span style="COLOR: #c0c0c0">last</span>) <span style="COLOR: #c0c0c0">==</span> <span style="COLOR: #c0c0c0">NULL</span> ))<br />
<span style="COLOR: #696969">27</span>                 <span style="COLOR: #00ffff; FONT-WEIGHT: bold">return</span> (<span style="COLOR: #c0c0c0">NULL</span>);<br />
<span style="COLOR: #696969">28</span><br />
<span style="COLOR: #696969">29</span>         <span style="COLOR: #c0c0c0">last</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #c0c0c0">strstr</span>(<span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #c0c0c0">delim</span>);<br />
<span style="COLOR: #f810b0">30</span><br />
<span style="COLOR: #696969">31</span>         <span style="COLOR: #00ffff; FONT-WEIGHT: bold">if</span> (<span style="COLOR: #c0c0c0">NULL</span> <span style="COLOR: #c0c0c0">==</span> <span style="COLOR: #c0c0c0">last</span>) <span style="COLOR: #c0c0c0">{</span><br />
<span style="COLOR: #696969">32</span>                 <span style="COLOR: #00ffff; FONT-WEIGHT: bold">return</span> <span style="COLOR: #c0c0c0">NULL</span>;<br />
<span style="COLOR: #696969">33</span>         <span style="COLOR: #c0c0c0">}</span> <span style="COLOR: #00ffff; FONT-WEIGHT: bold">else</span> <span style="COLOR: #c0c0c0">{</span><br />
<span style="COLOR: #696969">34</span>                 <span style="COLOR: #c0c0c0">t</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #c0c0c0">malloc</span>(<span style="COLOR: #c0c0c0">strlen</span>(<span style="COLOR: #c0c0c0">str</span>) <span style="COLOR: #c0c0c0">+</span> <span style="COLOR: #c0c0c0">1</span>);<br />
<span style="COLOR: #f810b0">35</span>                 <span style="COLOR: #c0c0c0">memset</span>(<span style="COLOR: #c0c0c0">t</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #c0c0c0">0</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #c0c0c0">strlen</span>(<span style="COLOR: #c0c0c0">t</span>));<br />
<span style="COLOR: #696969">36</span>                 <span style="COLOR: #00ffff; FONT-WEIGHT: bold">for</span>(<span style="COLOR: #c0c0c0">i</span><span style="COLOR: #c0c0c0">=</span><span style="COLOR: #c0c0c0">0</span>; <span style="COLOR: #c0c0c0">i</span> <span style="COLOR: #c0c0c0">&lt;</span> (<span style="COLOR: #c0c0c0">strlen</span>(<span style="COLOR: #c0c0c0">str</span>) <span style="COLOR: #c0c0c0">-</span> <span style="COLOR: #c0c0c0">strlen</span>(<span style="COLOR: #c0c0c0">last</span>)); <span style="COLOR: #c0c0c0">++</span><span style="COLOR: #c0c0c0">i</span>) <span style="COLOR: #c0c0c0">{</span><br />
<span style="COLOR: #696969">37</span><br />
<span style="COLOR: #696969">38</span>                         <span style="COLOR: #c0c0c0">t</span><span style="COLOR: #c0c0c0">[</span><span style="COLOR: #c0c0c0">i</span><span style="COLOR: #c0c0c0">]</span> <span style="COLOR: #c0c0c0">=</span> <span style="COLOR: #c0c0c0">str</span><span style="COLOR: #c0c0c0">[</span><span style="COLOR: #c0c0c0">i</span><span style="COLOR: #c0c0c0">];</span><br />
<span style="COLOR: #696969">39</span>                 <span style="COLOR: #c0c0c0">}</span><br />
<span style="COLOR: #f810b0">40</span><br />
<span style="COLOR: #696969">41</span>                 <span style="COLOR: #00ffff; FONT-WEIGHT: bold">while</span>(<span style="COLOR: #c0c0c0">last</span> <span style="COLOR: #c0c0c0">==</span> <span style="COLOR: #c0c0c0">strstr</span>(<span style="COLOR: #c0c0c0">last</span><span style="COLOR: #c0c0c0">,</span> <span style="COLOR: #c0c0c0">delim</span>))<br />
<span style="COLOR: #696969">42</span>                      <span style="COLOR: #c0c0c0">*</span><span style="COLOR: #c0c0c0">last</span><span style="COLOR: #c0c0c0">++</span>;<br />
<span style="COLOR: #696969">43</span>                 <span style="COLOR: #00ffff; FONT-WEIGHT: bold">return</span> <span style="COLOR: #c0c0c0">t</span>;<br />
<span style="COLOR: #696969">44</span>         <span style="COLOR: #c0c0c0">}</span><br />
<span style="COLOR: #f810b0">45</span> <span style="COLOR: #c0c0c0">}</span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2009/09/29/how_sick_my_c_programm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用colinux安装ubuntu</title>
		<link>http://blog.tonice.me/2009/09/16/use_colinux_install_ubuntu_on_windows/</link>
		<comments>http://blog.tonice.me/2009/09/16/use_colinux_install_ubuntu_on_windows/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:49:42 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[Linux Style]]></category>
		<category><![CDATA[colinux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=14</guid>
		<description><![CDATA[使用colinux安装ubuntu 1.colinux和ubuntu简介 2.colinux和其它虚拟机相比有什么优势 3.安装和配置colinux 4.其它扩展相关 5.参考 1.colinux和ubuntu简介  Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively.colinux是一款虚拟机软件和其它的qmenu、vmware、virtualpc类似，但是colinux只能在windows上虚拟linux，官网在这里http://www.colinux.org/。  Ubuntu 发&#8221;oo-BOON-too&#8221;音，是一款免费、开源、易于使用的linux发行版。官网在这http://www.ubuntu.com/ 2.colinux和其它虚拟机相比有什么优势  colinux其优势是修改了Linux的内核在Windows下使用Ring0（内核层）来直接使用硬件设备，使Kernel“虚拟化”的结果，其特点是由于能直接使用Host上的设备，CPU效率得以提高（据说其效率与直接在机器上装Linux还高，这一点是其它虚拟机软件不能比的）。 3.安装和配置colinux        从官网http://www.colinux.org/下载最新stable的colinux，在从这里http://sourceforge.net/projects/colinux/files/(选择Images 2.6.x Ubuntu =&#62; Ubuntu 9.04 =&#62; Ubuntu-9.04-1gb.7z)下载最新的colinux ubuntu的image文件。        将colinux安装在一个简单的路径如d:\colinux。把下载的ubuntu Image文件一起放到D:\colinux，我们接下来要配置配置文件。  配置文件内容 ______________________________________________________________________________________________  # 这是核心文件，无需改动  kernel=vmlinux    # File contains the root [...]]]></description>
			<content:encoded><![CDATA[<p>使用colinux安装ubuntu</p>
<p>1.<a href="#c1">colinux和ubuntu简介</a><br />
2.<a href="#c2">colinux和其它虚拟机相比有什么优势</a><br />
3.<a href="#c3">安装和配置colinux</a><br />
4.<a href="#c4">其它扩展相关</a><br />
5.<a href="#c5">参考</a><br />
<strong>1.colinux和ubuntu简介</strong><a name="c1"></a><br />
 Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively.colinux是一款虚拟机软件和其它的qmenu、vmware、virtualpc类似，但是colinux只能在windows上虚拟linux，官网在这里<a href="http://www.colinux.org/">http://www.colinux.org/</a>。</p>
<p> Ubuntu 发&#8221;oo-BOON-too&#8221;音，是一款免费、开源、易于使用的linux发行版。官网在这<a href="http://www.ubuntu.com/">http://www.ubuntu.com/</a></p>
<p><strong>2.colinux和其它虚拟机相比有什么优势</strong><a name="c2"></a><br />
 colinux其优势是修改了Linux的内核在Windows下使用Ring0（内核层）来直接使用硬件设备，使Kernel“虚拟化”的结果，其特点是由于能直接使用Host上的设备，CPU效率得以提高（据说其效率与直接在机器上装Linux还高，这一点是其它虚拟机软件不能比的）。</p>
<p><strong>3.安装和配置colinux</strong><a name="c3"></a><br />
       从官网<a href="http://www.colinux.org/">http://www.colinux.org/</a>下载最新stable的colinux，在从这里<a href="http://sourceforge.net/projects/colinux/files/">http://sourceforge.net/projects/colinux/files/</a>(选择Images 2.6.x Ubuntu =&gt; Ubuntu 9.04 =&gt; Ubuntu-9.04-1gb.7z)下载最新的colinux ubuntu的image文件。</p>
<p>       将colinux安装在一个简单的路径如d:\colinux。把下载的ubuntu Image文件一起放到D:\colinux，我们接下来要配置配置文件。</p>
<p> <strong>配置文件内容</strong><br />
______________________________________________________________________________________________<br />
 # 这是核心文件，无需改动<br />
 kernel=vmlinux<br />
 <br />
 # File contains the root file system.<br />
 # Download and extract preconfigured file from SF &#8220;Images for 2.6&#8243;.<br />
 # 含有根文件系统的文件，其中这个 cobd0 将作为一个Block file存于 Linux OS的 /dev/ 下。<br />
 cobd0=&#8221;D:\colinux\Ubuntu-9.04.ext3.1gb.fs&#8221;<br />
 <br />
 # coLinux的内核中编译了一个特殊的文件系统 cofs，是为了与Windows共享文件用的，这里共享 d:\<br />
 cofs0=d:\<br />
 <br />
 # Swap device, should be an empty file with 128..512MB.<br />
 # 这是Swap设备指定的文件，这个文件需要另外下载<br />
 cobd1=&#8221;d:\colinux\swap.img&#8221;<br />
 <br />
 # Tell kernel the name of root device (mostly /dev/cobd0,<br />
 # /dev/cobd/0 on Gentoo)<br />
 # This parameter will be forward to Linux kernel.<br />
 # 这是传递给内核，在哪寻找根文件系统的参数。按照上面的设定，我们将其放到了 /dev/cobd0 下<br />
 root=/dev/cobd0<br />
 <br />
 # Additional kernel parameters (ro = rootfs mount read only)<br />
 # 附加的内核参数，不需改动<br />
 ro<br />
 <br />
 # Initrd installs modules into the root file system.<br />
 # Need only on first boot.<br />
 # 内核启动所需的虚拟软盘镜像，也不需要改动<br />
 initrd=initrd.gz<br />
 <br />
 # Maximal memory for linux guest<br />
 # 这个虚拟机最多使用的内存，单位为兆字节<br />
 mem=256<br />
 <br />
 # Slirp for internet connection (outgoing)<br />
 # Inside running coLinux configure eth0 with this static settings:<br />
 # ipaddress 10.0.2.15   broadcast  10.0.2.255   netmask 255.255.255.0<br />
 # gateway   10.0.2.2    nameserver 10.0.2.3<br />
 # 这是网络配置的内容，在后面将详细谈到，现在先按这个设置<br />
 eth0=slirp,,tcp:5901:5900/tcp:6699:22/udp:6699:22</p>
<p>________________________________________________________________________________ <br />
将该文件保存到 d:\coLinux 下为 ubuntu.conf</p>
<p> 接着就可以运行以下命令启动了</p>
<p> 1.直接从命令行启动<br />
 C:\&gt; d:\coLinux\colinux-daemon.exe @ubuntu.conf</p>
<p> 2.作为系统服务<br />
 C:\&gt; d:\coLinux\colinux-daemon.exe –install-service “ubuntu” @ubuntu.conf</p>
<p> 于是就可以以服务的方式管理这个虚拟机了。例如启动它：</p>
<p> c:\&gt; net start ubuntu</p>
<p> 若以服务方式启动，则需要手工打开 Console，才能看到其启动的样子，否则它在后台运行。这个Console在coLinux下，分别为colinux-console-fltk.exe和colinux-console-nt.exe。<br />
 <br />
<strong> 网络的配置</strong></p>
<p> coLinux有三种网络工作模式，即NAT、BRIDGE、TUNTAP。下面只介绍NAT和TUNTAP两种方式，BRIDGE由于我没有试成功，不便说明。</p>
<p> 1. NAT（Network Address Translation，网络地址转换）<br />
  NAT是最常见，也是最容易配置的。NAT的工作模式简单来说，就是由Host OS对外来的请求进行转换，如若有Guest OS需要的包，则直接转换给Guest OS。它的优点就是配置简单，HOST OS程序使用DHCP服务器给GUEST OS分配IP地址，这时Guest OS对外部是不可见的，也就是包只能出，不能进（当然，经过转换的就可以进来）。</p>
<p>  配置文件中关于NAT的配置为</p>
<p>  ethX=slirp,&lt;MAC&gt;,&lt;redirections&gt;</p>
<p>  刚才的配置文件中写道，</p>
<p>  eth0=slirp,,tcp:5901:5900/tcp:6699:22/udp:6699:22<br />
  即没有指定MAC地址，将Guest的5900，22端口映射到Host的5901，6699端口。这时候从外部访问6699和5901，就可以访问到Linux的5900和22端口了！</p>
<p> 2.TUNTAP<br />
  这种连接其实就是在Host OS上建一虚拟网卡与Guest OS通信，组成一个私有网络。通迅之前，在Windows的网络连接设置中，为被coLinux新建的网卡设定一个局域网的IP地址如192.168.10.1 。coLinux的配置文件中此方式为</p>
<p>  ethX=tuntap,&lt;network connection name&gt;,&lt;MAC&gt;</p>
<p>  如果有多个tuntap的网卡，则需要指定一个名称。在此没有那么多复杂的情况，我们就直接使用</p>
<p>  eth0=tuntap</p>
<p>  即可。到了Linux下之后，再利用 ifconfig 来配置网卡，便可通主机通讯了。若要在此方式下让Guest　OS上网，则需要启动Windows的Internet连接共享，只要将Internet连接设置为共享，然后指定为TUNTAP共享即可，在此不再赘述。</p>
<p> </p>
<p><strong>4.其它扩展相关</strong><a name="c4"></a></p>
<p> 1.X的配置 <a href="http://colinux.wikia.com/wiki/XCoLinux">http://colinux.wikia.com/wiki/XCoLinux</a><br />
 2.添加一个swap分区 <a href="http://colinux.wikia.com/wiki/HowtoCreateSwapFile">http://colinux.wikia.com/wiki/HowtoCreateSwapFile</a><br />
 3.添加windows硬盘(让colinux使用本机windows的分区) <a href="http://colinux.wikia.com/wiki/Partitions#mount_the_partition">http://colinux.wikia.com/wiki/Partitions#mount_the_partition</a><br />
 5.增加images文件大小 <a href="http://colinux.wikia.com/wiki/ExpandingRoot">http://colinux.wikia.com/wiki/ExpandingRoot</a></p>
<p><strong>5.参考</strong><a name="c5"></a><br />
 1.<a href="http://blog.simophin.cn/?p=123" target="_blank">http://blog.simophin.cn/?p=123</a><br />
 2.<a href="http://colinux.wikia.com/" target="_blank">http://colinux.wikia.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2009/09/16/use_colinux_install_ubuntu_on_windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>神田川</title>
		<link>http://blog.tonice.me/2009/09/15/%e7%a5%9e%e7%94%b0%e5%b7%9d/</link>
		<comments>http://blog.tonice.me/2009/09/15/%e7%a5%9e%e7%94%b0%e5%b7%9d/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 12:47:14 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[靡靡之音]]></category>
		<category><![CDATA[歌曲]]></category>
		<category><![CDATA[神田川]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=10</guid>
		<description><![CDATA[歌手：南こうせつとかぐや姫 作词： 喜多条忠 作曲：南こうせつ 歌词：  貴方は　もう忘れたかしら 赤いてぬぐい マフラーにして 二人で行った 横丁の風呂屋 一緒に出ようねって 言ったのに いつも私が待たされた 洗い髪が芯まで冷えて 小さな石鹸 カタカタ鳴った 貴方は私の　からだを抱いて 冷たいねって 言ったのよ 若かったあの頃　何も恐くなかった ただ貴方のやさしさが 恐かった 貴方はもう捨てたのかしら 二十四色のクレパス買って 貴方が描いた 私の似顔絵 うまく描いてねって 言ったのに いつもちっとも 似てないの 窓の下には神田川 三畳一間の小さな下宿 貴方は私の指先見つめ 悲しいかって きいたのよ 若かったあの頃　何も恐くなかった ただ貴方のやさしさが 恐かった]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="src" value="http://player.youku.com/player.php/Type/Folder/Fid/1474515/Ob/1/Pt/3/sid/XMjExNTM1NTY=/v.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/Type/Folder/Fid/1474515/Ob/1/Pt/3/sid/XMjExNTM1NTY=/v.swf" quality="high" align="middle"></embed></object></p>
<p>歌手：南こうせつとかぐや姫<br />
作词：<br />
喜多条忠<br />
作曲：南こうせつ</p>
<p>歌词： <br />
貴方は　もう忘れたかしら<br />
赤いてぬぐい マフラーにして<br />
二人で行った 横丁の風呂屋<br />
一緒に出ようねって 言ったのに</p>
<p>いつも私が待たされた<br />
洗い髪が芯まで冷えて<br />
小さな石鹸 カタカタ鳴った<br />
貴方は私の　からだを抱いて<br />
冷たいねって 言ったのよ</p>
<p>若かったあの頃　何も恐くなかった<br />
ただ貴方のやさしさが 恐かった</p>
<p>貴方はもう捨てたのかしら<br />
二十四色のクレパス買って<br />
貴方が描いた 私の似顔絵<br />
うまく描いてねって 言ったのに</p>
<p>いつもちっとも 似てないの<br />
窓の下には神田川<br />
三畳一間の小さな下宿<br />
貴方は私の指先見つめ<br />
悲しいかって きいたのよ</p>
<p>若かったあの頃　何も恐くなかった<br />
ただ貴方のやさしさが 恐かった</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2009/09/15/%e7%a5%9e%e7%94%b0%e5%b7%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP smtp邮件群发程序</title>
		<link>http://blog.tonice.me/2009/09/15/mass-send-email-with-phpmailer/</link>
		<comments>http://blog.tonice.me/2009/09/15/mass-send-email-with-phpmailer/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 11:41:11 +0000</pubDate>
		<dc:creator>3xil3r</dc:creator>
				<category><![CDATA[PHP之美]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[邮件群发]]></category>

		<guid isPermaLink="false">http://blog.tonice.me/?p=1</guid>
		<description><![CDATA[啥也不说了 上代码 PHP语言: Codee#6096 001 &#60;?php 002 /** 003 *通过phpmailer发送qq邮件 004 *@author ray 005 *@since 2009-08-07 006 */ 007 define(&#8216;__DEBUG__&#8217;, false); 008 define(&#8216;__PSW_FILE__&#8217;, dirname(__FILE__) . &#8216;/smtp.dat&#8217;); 009 define(&#8216;SLEEPING_EMAIL&#8217;, dirname(__FILE__) . &#8220;/sleepMail.dat&#8221;);//休眠的email 010 define(&#8216;SLEEPING_TIME&#8217;, 1800);//休眠多长时间，以秒为单位 011 define(&#8216;FILE_APPEND&#8217;, 1); 012 if (!function_exists(&#8216;file_put_contents&#8217;)) { 013     function file_put_contents($n, $d, $flag = false) { 014         $mode = ($flag [...]]]></description>
			<content:encoded><![CDATA[<p>啥也不说了 上代码</p>
<div style="background: #fdfdfd; color: black;"><span style="text-decoration: underline;">PHP语言</span>: <a href="http://fayaa.com/code/view/6096/">Codee#6096</a></div>
<div class="source" style="background-color: #000000; font-family: 'None','Consolas','Lucida Console','Courier New'; color: #c0c0c0;"><span style="color: #696969;">001</span> <span style="color: #ffffff;">&lt;?php</span><br />
<span style="color: #696969;">002</span> <span style="color: #00bbbb;">/**</span><br />
<span style="color: #696969;">003</span> <span style="color: #00bbbb;">*通过phpmailer发送qq邮件</span><br />
<span style="color: #696969;">004</span> <span style="color: #00bbbb;">*@author ray</span><br />
<span style="color: #f810b0;">005</span> <span style="color: #00bbbb;">*@since 2009-08-07</span><br />
<span style="color: #696969;">006</span> <span style="color: #00bbbb;">*/</span><br />
<span style="color: #696969;">007</span> <span style="color: #c0c0c0;">define</span>(<span style="color: #00bbbb;">&#8216;__DEBUG__&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #00ffff; font-weight: bold;">false</span>);<br />
<span style="color: #696969;">008</span> <span style="color: #c0c0c0;">define</span>(<span style="color: #00bbbb;">&#8216;__PSW_FILE__&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">dirname</span>(<span style="color: #00ffff; font-weight: bold;">__FILE__</span>) <span style="color: #c0c0c0;">.</span> <span style="color: #00bbbb;">&#8216;/smtp.dat&#8217;</span>);<br />
<span style="color: #696969;">009</span> <span style="color: #c0c0c0;">define</span>(<span style="color: #00bbbb;">&#8216;SLEEPING_EMAIL&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">dirname</span>(<span style="color: #00ffff; font-weight: bold;">__FILE__</span>) <span style="color: #c0c0c0;">.</span> <span style="color: #00bbbb;">&#8220;/sleepMail.dat&#8221;</span>);<span style="color: #696969;">//休眠的email</span><br />
<span style="color: #f810b0;">010</span> <span style="color: #c0c0c0;">define</span>(<span style="color: #00bbbb;">&#8216;SLEEPING_TIME&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">1800</span>);<span style="color: #696969;">//休眠多长时间，以秒为单位</span><br />
<span style="color: #696969;">011</span> <span style="color: #c0c0c0;">define</span>(<span style="color: #00bbbb;">&#8216;FILE_APPEND&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">1</span>);<br />
<span style="color: #696969;">012</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #c0c0c0;">function_exists</span>(<span style="color: #00bbbb;">&#8216;file_put_contents&#8217;</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">013</span>     <span style="color: #00ffff; font-weight: bold;">function</span> <span style="color: #00ffff;">file_put_contents</span>(<span style="color: #00cccc;">$n</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$d</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$flag</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00ffff; font-weight: bold;">false</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">014</span>         <span style="color: #00cccc;">$mode</span> <span style="color: #c0c0c0;">=</span> (<span style="color: #00cccc;">$flag</span> <span style="color: #c0c0c0;">==</span> <span style="color: #c0c0c0;">FILE_APPEND</span> || <span style="color: #c0c0c0;">strtoupper</span>(<span style="color: #00cccc;">$flag</span>) <span style="color: #c0c0c0;">==</span> <span style="color: #00bbbb;">&#8216;FILE_APPEND&#8217;</span>) <span style="color: #c0c0c0;">?</span> <span style="color: #00bbbb;">&#8216;a&#8217;</span> <span style="color: #c0c0c0;">:</span> <span style="color: #00bbbb;">&#8216;w&#8217;</span>;<br />
<span style="color: #f810b0;">015</span>         <span style="color: #00cccc;">$f</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">@</span><span style="color: #c0c0c0;">fopen</span>(<span style="color: #00cccc;">$n</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$mode</span>);<br />
<span style="color: #696969;">016</span>         <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #00cccc;">$f</span> <span style="color: #c0c0c0;">===</span> <span style="color: #00ffff; font-weight: bold;">false</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">017</span>             <span style="color: #00ffff; font-weight: bold;">return</span> <span style="color: #c0c0c0;">0</span>;<br />
<span style="color: #696969;">018</span>         <span style="color: #c0c0c0;">}</span> <span style="color: #00ffff; font-weight: bold;">else</span> <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">019</span>             <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">is_array</span>(<span style="color: #00cccc;">$d</span>)) <span style="color: #00cccc;">$d</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">implode</span>(<span style="color: #00cccc;">$d</span>);<br />
<span style="color: #f810b0;">020</span>             <span style="color: #00cccc;">$bytesWritten</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">fwrite</span>(<span style="color: #00cccc;">$f</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$d</span>);<br />
<span style="color: #696969;">021</span>             <span style="color: #c0c0c0;">fclose</span>(<span style="color: #00cccc;">$f</span>);<br />
<span style="color: #696969;">022</span>             <span style="color: #00ffff; font-weight: bold;">return</span> <span style="color: #00cccc;">$bytesWritten</span>;<br />
<span style="color: #696969;">023</span>         <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">024</span>     <span style="color: #c0c0c0;">}</span><br />
<span style="color: #f810b0;">025</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">026</span> <span style="color: #00cccc;">$errorNo</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">0</span>;<br />
<span style="color: #696969;">027</span> <span style="color: #00cccc;">$errorMsg</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00bbbb;">&#8221;</span>;<br />
<span style="color: #696969;">028</span> <span style="color: #00cccc;">$currTime</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">time</span>();<br />
<span style="color: #696969;">029</span> <span style="color: #00cccc;">$unuseMails</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00ffff; font-weight: bold;">array</span>();<br />
<span style="color: #f810b0;">030</span> <span style="color: #696969;">//收件人和邮件标题和邮件内容</span><br />
<span style="color: #696969;">031</span> <span style="color: #00cccc;">$to</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$argv</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">?</span> <span style="color: #00cccc;">$argv</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">]</span> <span style="color: #c0c0c0;">:</span> <span style="color: #00bbbb;">&#8220;&#8221;</span> ;<br />
<span style="color: #696969;">032</span> <span style="color: #00cccc;">$subject</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$argv</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">2</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">?</span> <span style="color: #00cccc;">$argv</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">2</span><span style="color: #c0c0c0;">]</span> <span style="color: #c0c0c0;">:</span> <span style="color: #00bbbb;">&#8220;&#8221;</span>;<br />
<span style="color: #696969;">033</span> <span style="color: #00cccc;">$mailFile</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$argv</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">3</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">?</span> <span style="color: #00cccc;">$argv</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">3</span><span style="color: #c0c0c0;">]</span> <span style="color: #c0c0c0;">:</span> <span style="color: #00bbbb;">&#8220;&#8221;</span> ;<br />
<span style="color: #696969;">034</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">__DEBUG__</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #f810b0;">035</span>     <span style="color: #00ffff; font-weight: bold;">echo</span> <span style="color: #00bbbb;">&#8221; </span><br />
<span style="color: #696969;">036</span> <span style="color: #00bbbb;">file:</span><span style="color: #00bbbb;">$mailFile</span><span style="color: #00bbbb;"> to:</span><span style="color: #00bbbb;">$to</span><span style="color: #00bbbb;"> subject:</span><span style="color: #00bbbb;">$subject</span><span style="color: #00bbbb;">\r\n</span><span style="color: #00bbbb;">&#8220;</span>;<br />
<span style="color: #696969;">037</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">038</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #00ffff; font-weight: bold;">empty</span>(<span style="color: #00cccc;">$mailFile</span>) || <span style="color: #00ffff; font-weight: bold;">empty</span>(<span style="color: #00cccc;">$to</span>) || <span style="color: #00ffff; font-weight: bold;">empty</span>(<span style="color: #00cccc;">$subject</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">039</span>     <span style="color: #00cccc;">$errorNo</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">1</span>;<br />
<span style="color: #f810b0;">040</span>     <span style="color: #00cccc;">$errorMsg</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00bbbb;">&#8220;参数不全&#8221;</span>;<br />
<span style="color: #696969;">041</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">042</span> <span style="color: #696969;">//加载不可用的email列表</span><br />
<span style="color: #696969;">043</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #00cccc;">$errorNo</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">044</span>     <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">file_exists</span>(<span style="color: #c0c0c0;">SLEEPING_EMAIL</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #f810b0;">045</span>         <span style="color: #00cccc;">$sleepMails</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">file</span>(<span style="color: #c0c0c0;">SLEEPING_EMAIL</span>);<br />
<span style="color: #696969;">046</span>         <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #00ffff; font-weight: bold;">empty</span>(<span style="color: #00cccc;">$sleepMails</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">047</span>        <br />
<span style="color: #696969;">048</span>             <span style="color: #00ffff; font-weight: bold;">foreach</span>(<span style="color: #00cccc;">$sleepMails</span> <span style="color: #00ffff; font-weight: bold;">as</span> <span style="color: #00cccc;">$sleepMail</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">049</span>                 <span style="color: #696969;">//解析</span><br />
<span style="color: #f810b0;">050</span>                 <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #00ffff; font-weight: bold;">false</span> <span style="color: #c0c0c0;">!==</span> <span style="color: #c0c0c0;">strpos</span>(<span style="color: #00cccc;">$sleepMail</span><span style="color: #c0c0c0;">,</span> <span style="color: #00bbbb;">&#8216;|&#8217;</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">051</span>                     <span style="color: #00cccc;">$tmp</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">explode</span>(<span style="color: #00bbbb;">&#8216;|&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$sleepMail</span>);<br />
<span style="color: #696969;">052</span>                     <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">0</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">&amp;&amp;</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">]))</span> <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">053</span>                         <span style="color: #00cccc;">$mail</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">trim</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">0</span><span style="color: #c0c0c0;">]);</span><br />
<span style="color: #696969;">054</span>                         <span style="color: #00cccc;">$time</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">trim</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">]);</span><br />
<span style="color: #f810b0;">055</span>                        <br />
<span style="color: #696969;">056</span>                         <span style="color: #696969;">//是否可用</span><br />
<span style="color: #696969;">057</span>                         <span style="color: #00ffff; font-weight: bold;">if</span> ( (<span style="color: #00cccc;">$currTime</span> <span style="color: #c0c0c0;">-</span> <span style="color: #00cccc;">$time</span> )<span style="color: #c0c0c0;">&lt;</span> <span style="color: #c0c0c0;">SLEEPING_TIME</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">058</span>                             <span style="color: #00cccc;">$unuseMails</span><span style="color: #c0c0c0;">[]</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$mail</span>;<br />
<span style="color: #696969;">059</span>                         <span style="color: #c0c0c0;">}</span><br />
<span style="color: #f810b0;">060</span>                     <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">061</span>                 <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">062</span>             <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">063</span>         <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">064</span>     <span style="color: #c0c0c0;">}</span><br />
<span style="color: #f810b0;">065</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">066</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #00cccc;">$errorNo</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">067</span>     <span style="color: #696969;">//随机加载smtp服务器和smtp用户名和密码</span><br />
<span style="color: #696969;">068</span>     <span style="color: #00cccc;">$info</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">file</span>(<span style="color: #c0c0c0;">__PSW_FILE__</span>);<br />
<span style="color: #696969;">069</span>     <span style="color: #00cccc;">$len</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">count</span>(<span style="color: #00cccc;">$info</span>);<br />
<span style="color: #f810b0;">070</span>    <br />
<span style="color: #696969;">071</span>     <span style="color: #00ffff; font-weight: bold;">do</span> <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">072</span>         <span style="color: #00cccc;">$rnd</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">mt_rand</span>(<span style="color: #c0c0c0;">0</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$len</span> <span style="color: #c0c0c0;">-</span> <span style="color: #c0c0c0;">1</span>);<br />
<span style="color: #696969;">073</span>         <span style="color: #00cccc;">$line</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$info</span><span style="color: #c0c0c0;">[</span><span style="color: #00cccc;">$rnd</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">?</span> <span style="color: #00cccc;">$info</span><span style="color: #c0c0c0;">[</span><span style="color: #00cccc;">$rnd</span><span style="color: #c0c0c0;">]</span> <span style="color: #c0c0c0;">:</span> <span style="color: #00bbbb;">&#8220;&#8221;</span>;<br />
<span style="color: #696969;">074</span>        <br />
<span style="color: #f810b0;">075</span>         <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #00ffff; font-weight: bold;">false</span> <span style="color: #c0c0c0;">!==</span> <span style="color: #c0c0c0;">strpos</span>(<span style="color: #00cccc;">$line</span><span style="color: #c0c0c0;">,</span> <span style="color: #00bbbb;">&#8216;|&#8217;</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">076</span>        <br />
<span style="color: #696969;">077</span>             <span style="color: #00cccc;">$tmp</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">explode</span>(<span style="color: #00bbbb;">&#8216;|&#8217;</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$line</span>);<br />
<span style="color: #696969;">078</span>             <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">0</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">&amp;&amp;</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">])</span> <span style="color: #c0c0c0;">&amp;&amp;</span> <span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">2</span><span style="color: #c0c0c0;">]))</span> <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">079</span>                <br />
<span style="color: #f810b0;">080</span>                 <span style="color: #00cccc;">$smtpServer</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">trim</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">0</span><span style="color: #c0c0c0;">]);</span><br />
<span style="color: #696969;">081</span>                 <span style="color: #00cccc;">$fromMail</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">trim</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">]);</span><br />
<span style="color: #696969;">082</span>                 <span style="color: #00cccc;">$psw</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">trim</span>(<span style="color: #00cccc;">$tmp</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">2</span><span style="color: #c0c0c0;">]);</span><br />
<span style="color: #696969;">083</span>                 <span style="color: #00cccc;">$smtpUserName</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">substr</span>(<span style="color: #00cccc;">$fromMail</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">0</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">strrpos</span>(<span style="color: #00cccc;">$fromMail</span><span style="color: #c0c0c0;">,</span> <span style="color: #00bbbb;">&#8216;@&#8217;</span>));<br />
<span style="color: #696969;">084</span>             <span style="color: #c0c0c0;">}</span><br />
<span style="color: #f810b0;">085</span>         <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">086</span>     <span style="color: #c0c0c0;">}</span><span style="color: #00ffff; font-weight: bold;">while</span> (<span style="color: #c0c0c0;">in_array</span>(<span style="color: #00cccc;">$fromMail</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$unuseMails</span>));<span style="color: #696969;">//如果在不可用的列表中，在次加载</span><br />
<span style="color: #696969;">087</span>    <br />
<span style="color: #696969;">088</span>     <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$smtpServer</span>) || <span style="color: #c0c0c0;">!</span><span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$fromMail</span>) || <span style="color: #c0c0c0;">!</span><span style="color: #c0c0c0;">isset</span>(<span style="color: #00cccc;">$psw</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">089</span>         <span style="color: #00cccc;">$errorNo</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">2</span>;<br />
<span style="color: #f810b0;">090</span>         <span style="color: #00cccc;">$errorMsg</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00bbbb;">&#8220;没找到发件人QQ信箱和密码&#8221;</span>;<br />
<span style="color: #696969;">091</span>     <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">092</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">093</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #00cccc;">$errorNo</span> <span style="color: #c0c0c0;">&amp;&amp;</span> <span style="color: #c0c0c0;">__DEBUG__</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">094</span>     <span style="color: #00ffff; font-weight: bold;">echo</span> <span style="color: #00bbbb;">&#8220;smtp:</span><span style="color: #00bbbb;">$smtpServer</span><span style="color: #00bbbb;"> from:</span><span style="color: #00bbbb;">$fromMail</span><span style="color: #00bbbb;"> psw:</span><span style="color: #00bbbb;">$psw</span><span style="color: #00bbbb;"> user:</span><span style="color: #00bbbb;">$smtpUserName</span><span style="color: #00bbbb;">\r\n</span><span style="color: #00bbbb;">&#8220;</span>;<br />
<span style="color: #f810b0;">095</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">096</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #00cccc;">$errorNo</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">097</span>     <span style="color: #696969;">//通过phpmailer连接smtp服务器发信</span><br />
<span style="color: #696969;">098</span>     <span style="color: #00ffff; font-weight: bold;">require</span>(<span style="color: #c0c0c0;">dirname</span>(<span style="color: #00ffff; font-weight: bold;">__FILE__</span>) <span style="color: #c0c0c0;">.</span> <span style="color: #00bbbb;">&#8220;/phpmailer/class.phpmailer.php&#8221;</span>);<br />
<span style="color: #696969;">099</span>     <span style="color: #00ffff; font-weight: bold;">require</span>(<span style="color: #c0c0c0;">dirname</span>(<span style="color: #00ffff; font-weight: bold;">__FILE__</span>) <span style="color: #c0c0c0;">.</span> <span style="color: #00bbbb;">&#8220;/phpmailer/class.smtp.php&#8221;</span>);<br />
<span style="color: #f810b0;">100</span>     <span style="color: #00cccc;">$mail</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00ffff; font-weight: bold;">new</span> <span style="color: #c0c0c0;">PHPMailer</span>();<br />
<span style="color: #696969;">101</span>    <br />
<span style="color: #696969;">102</span>     <span style="color: #00cccc;">$body</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">getFile</span>(<span style="color: #00cccc;">$mailFile</span>);<br />
<span style="color: #696969;">103</span>     <span style="color: #00cccc;">$body</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">eregi_replace</span>(<span style="color: #00bbbb;">&#8220;[\]&#8220;</span><span style="color: #c0c0c0;">,</span><span style="color: #00bbbb;">&#8221;</span><span style="color: #c0c0c0;">,</span><span style="color: #00cccc;">$body</span>);<br />
<span style="color: #696969;">104</span>    <br />
<span style="color: #f810b0;">105</span>     <span style="color: #696969;">//charset</span><br />
<span style="color: #696969;">106</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">CharSet</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00bbbb;">&#8220;GB2312&#8243;</span>;<br />
<span style="color: #696969;">107</span>    <br />
<span style="color: #696969;">108</span>     <span style="color: #696969;">//$mail-&gt;SMTPDebug = 2;//用于显示具体的smtp错误</span><br />
<span style="color: #696969;">109</span>    <br />
<span style="color: #f810b0;">110</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">IsSMTP</span>();<br />
<span style="color: #696969;">111</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">SMTPAuth</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00ffff; font-weight: bold;">true</span>;<br />
<span style="color: #696969;">112</span>     <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #00bbbb;">&#8220;smtp.qq.com&#8221;</span> <span style="color: #c0c0c0;">==</span> <span style="color: #c0c0c0;">trim</span>(<span style="color: #00cccc;">$smtpServer</span>)) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">113</span>         <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Username</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$fromMail</span>;<br />
<span style="color: #696969;">114</span>     <span style="color: #c0c0c0;">}</span> <span style="color: #00ffff; font-weight: bold;">else</span> <span style="color: #c0c0c0;">{</span><br />
<span style="color: #f810b0;">115</span>         <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Username</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$smtpUserName</span>;<br />
<span style="color: #696969;">116</span>     <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">117</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Password</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$psw</span>;<br />
<span style="color: #696969;">118</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Host</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$smtpServer</span>;<br />
<span style="color: #696969;">119</span>    <br />
<span style="color: #f810b0;">120</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">From</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$fromMail</span>;<br />
<span style="color: #696969;">121</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">FromName</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00bbbb;">&#8220;&#8221;</span>;<br />
<span style="color: #696969;">122</span>    <br />
<span style="color: #696969;">123</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">IsHTML</span>(<span style="color: #00ffff; font-weight: bold;">true</span>);<br />
<span style="color: #696969;">124</span>    <br />
<span style="color: #f810b0;">125</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">AddAddress</span>(<span style="color: #00cccc;">$to</span>);<br />
<span style="color: #696969;">126</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Subject</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$subject</span>;<br />
<span style="color: #696969;">127</span>     <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Body</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$body</span>;<br />
<span style="color: #696969;">128</span>    <br />
<span style="color: #696969;">129</span>     <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">!</span><span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">Send</span>()) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #f810b0;">130</span>    <br />
<span style="color: #696969;">131</span>        <span style="color: #696969;">// echo &#8220;Message could not be sent. &#8220;;</span><br />
<span style="color: #696969;">132</span>         <span style="color: #00cccc;">$errorNo</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">3</span>;<br />
<span style="color: #696969;">133</span>         <span style="color: #00cccc;">$errorMsg</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00cccc;">$mail</span><span style="color: #c0c0c0;">-&gt;</span><span style="color: #00ffff;">ErrorInfo</span>;<br />
<span style="color: #696969;">134</span>     <span style="color: #c0c0c0;">}</span> <span style="color: #00ffff; font-weight: bold;">else</span> <span style="color: #c0c0c0;">{</span><br />
<span style="color: #f810b0;">135</span>         <span style="color: #00ffff; font-weight: bold;">echo</span> <span style="color: #00bbbb;">&#8221; </span><br />
<span style="color: #696969;">136</span> <span style="color: #00bbbb;">Send to </span><span style="color: #00bbbb;">$to</span><span style="color: #00bbbb;"> success use </span><span style="color: #00bbbb;">$fromMail</span><span style="color: #00bbbb;">\r\n</span><span style="color: #00bbbb;">&#8220;</span>;<br />
<span style="color: #696969;">137</span>         <span style="color: #00ffff; font-weight: bold;">exit</span>;<br />
<span style="color: #696969;">138</span>     <span style="color: #c0c0c0;">}</span><br />
<span style="color: #696969;">139</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #f810b0;">140</span> <span style="color: #00ffff; font-weight: bold;">if</span> (<span style="color: #c0c0c0;">3</span> <span style="color: #c0c0c0;">==</span> <span style="color: #00cccc;">$errorNo</span>) <span style="color: #c0c0c0;">{</span><br />
<span style="color: #696969;">141</span>     <span style="color: #696969;">//记录信息，该信息地址休眠N分钟</span><br />
<span style="color: #696969;">142</span>     <span style="color: #00cccc;">$content</span> <span style="color: #c0c0c0;">=</span> <span style="color: #00bbbb;">&#8220;</span><span style="color: #00bbbb;">$fromMail</span><span style="color: #00bbbb;">|&#8221;</span> <span style="color: #c0c0c0;">.</span> <span style="color: #c0c0c0;">time</span>() <span style="color: #c0c0c0;">.</span> <span style="color: #00bbbb;">&#8220;</span><span style="color: #00bbbb;">\r\n</span><span style="color: #00bbbb;">&#8220;</span>;<span style="color: #696969;">//email|当前时间戳</span><br />
<span style="color: #696969;">143</span>     <span style="color: #c0c0c0;">file_put_contents</span>(<span style="color: #c0c0c0;">SLEEPING_EMAIL</span><span style="color: #c0c0c0;">,</span> <span style="color: #00cccc;">$content</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">FILE_APPEND</span>);<br />
<span style="color: #696969;">144</span> <span style="color: #c0c0c0;">}</span><br />
<span style="color: #f810b0;">145</span> <span style="color: #00ffff; font-weight: bold;">echo</span> <span style="color: #00bbbb;">&#8221; </span><br />
<span style="color: #696969;">146</span> <span style="color: #00bbbb;">Error No(</span><span style="color: #00bbbb;">$errorNo</span><span style="color: #00bbbb;">) &#8220;</span> <span style="color: #c0c0c0;">.</span> <span style="color: #00cccc;">$errorMsg</span> <span style="color: #c0c0c0;">.</span> <span style="color: #00bbbb;">&#8220;</span><span style="color: #00bbbb;">\r\n</span><span style="color: #00bbbb;">&#8220;</span>;<br />
<span style="color: #696969;">147</span> <span style="color: #00ffff; font-weight: bold;">exit</span>;<br />
<span style="color: #696969;">148</span> <span style="color: #ffffff;">?&gt;</span></div>
<p>今天试着用该程序给qq信箱发了700多个推广邮件，得出了以下几个结论：<br />
1.smtp邮件帐号一定要多,不然会被qq服务器当作垃圾邮件。<br />
2.得适当的休眠</p>
<p>smtp.dat文件格式为<br />
smtp.163.com|<a href="mailto:sss@163.com">sss@163.com</a>|密码<br />
smtp.sina.com|<a href="mailto:www@sina.com">www@sina.com</a>|密码<br />
程序随机抽取一个连接，发送邮件，如果发送不成功，将该邮件地址存入sleepMail.dat休眠30分后在发送（这个是为了连接smtp服务器多次后发送不成功而做的修改）。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonice.me/2009/09/15/mass-send-email-with-phpmailer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

