海草房http://www.haicao.net/心若向阳 无畏悲伤,万博man手机注册-ManBetX万博全站app茶社分享IT经验,为IT男奉上一份心灵鸡汤海草房http://www.haicao.net/?id=14<p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">我们来看俩段通常对上传目录设置无权限的列子,配置如下:</p><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">代码如下:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory &quot;/var/www/upload&quot;&gt;<br style="margin: 0px; padding: 0px;"/>&lt;FilesMatch &quot;.php&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order Allow,Deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/FilesMatch&gt;<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">这些配置表面上看起来是没什么问题的,确实在windows下可以这么说。<br style="margin: 0px; padding: 0px;"/>但是linux就不同了,大家都是知道的linux操作系统是区分大小写的,这里如果换成大写后缀名*.phP一类就pass了</p><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">这里我说下我个人的解决方法,代码如下:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory &quot;要去掉PHP执行权限的目录路径,例如:D:/piaoyun.cc/upload&quot;&gt;<br style="margin: 0px; padding: 0px;"/>ErrorDocument 404 /404/404.html<br style="margin: 0px; padding: 0px;"/>ErrorDocument 403 /404/403.html<br style="margin: 0px; padding: 0px;"/>&lt;FilesMatch &quot;\.(?i:php|php3|php4)$&quot;&gt; // ?是尽可能多的匹配.php的字符串,i是不区分大小写,然后冒号后面跟上正则表达式,也可以写成:&lt;FilesMatch &quot;\.(php|php3)$&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/FilesMatch&gt;<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">上面的意思就是说,&lt;Directory &quot;要去掉PHP执行权限的目录路径,例如:D:/piaoyun.cc/upload&quot;&gt; 内目录路径下所有php文件不区分大小写,通过order,allow,deny原则判断拒绝执行php文件,对nginx同样也是可应用的</p><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">另外一种方法,是设置在htaccess里面的,这个方法比较灵活一点,针对那些没有apapche安全操作权限的网站管理员:<br style="margin: 0px; padding: 0px;"/>Apache环境规则内容如下:Apache执行php脚本限制 把这些规则添加到.htaccess文件中<br style="margin: 0px; padding: 0px;"/>代码如下:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">RewriteEngine on RewriteCond % !^$<br style="margin: 0px; padding: 0px;"/>RewriteRule uploads/(.*).(php)$ – [F]<br style="margin: 0px; padding: 0px;"/>RewriteRule data/(.*).(php)$ – [F]<br style="margin: 0px; padding: 0px;"/>RewriteRule templets/(.*).(php)$ –[F]</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">另外一种方法,代码如下:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory &quot;/var/www/upload&quot;&gt;<br style="margin: 0px; padding: 0px;"/>php_admin_flag engine off<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">此方法我在win系统下面测试失败了,重新启动apapche出现下面的错误信息:<br style="margin: 0px; padding: 0px;"/>The Apache service named reported the following error:<br style="margin: 0px; padding: 0px;"/>&gt;&gt;&gt; Invalid command &#39;php_flag&#39;, perhaps misspelled or defined by a module not included in the server configuration.</p><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">这里我就不具体说明这个解决办法了,因为禁止php执行的方法,大家看自己的需求去设置就可以了!</p><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">【apache配置禁止访问】<br style="margin: 0px; padding: 0px;"/>1. 禁止访问某些文件/目录<br style="margin: 0px; padding: 0px;"/>增加Files选项来控制,比如要不允许访问 .inc 扩展名的文件,保护php类库:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Files ~ &quot;\.inc$&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/Files&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">禁止访问某些指定的目录:(可以用 &lt;DirectoryMatch&gt; 来进行正则匹配)</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory ~ &quot;^/var/www/(.+/)*[0-9]{3}&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">通过文件匹配来进行禁止,比如禁止所有针对图片的访问:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;FilesMatch \.(?i:gif|jpe?g|png)$&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/FilesMatch&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">针对URL相对路径的禁止访问:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Location /dir/&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/Location&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">针对代理方式禁止对某些目标的访问(&lt;ProxyMatch&gt; 可以用来正则匹配),比如拒绝通过代理访问cnn.com:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Proxy http://piaoyun.cc/*&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/Proxy&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">2. 禁止某些IP访问/只允许某些IP访问<br style="margin: 0px; padding: 0px;"/>如果要控制禁止某些非法IP访问,在Directory选项控制:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory &quot;/var/www/web/&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Allow from all<br style="margin: 0px; padding: 0px;"/>Deny from 10.0.0.1 #阻止一个IP<br style="margin: 0px; padding: 0px;"/>Deny from 192.168.0.0/24 #阻止一个IP段<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">只允许某些IP访问,适合比如就允许内部或者合作公司访问:</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory &quot;/var/www/web/&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order deny,allow<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>All from example.com #允许某个域名<br style="margin: 0px; padding: 0px;"/>All from 10.0.0.1 #允许一个iP<br style="margin: 0px; padding: 0px;"/>All from 10.0.0.1 10.0.0.2 #允许多个iP<br style="margin: 0px; padding: 0px;"/>Allow from 10.1.0.0/255.255.0.0 #允许一个IP段,掩码对<br style="margin: 0px; padding: 0px;"/>All from 10.0.1 192.168 #允许一个IP段,后面不填写<br style="margin: 0px; padding: 0px;"/>All from 192.168.0.0/24 #允许一个IP段,网络号<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p style="margin: 10px auto; padding: 0px; color: rgb(57, 57, 57); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(250, 247, 239);">Apache:解决办法;</p><blockquote style="margin: 10px 0px; padding: 10px 60px 5px; background: url(&quot;/skins/summerGarden/images/comment.gif&quot;) 25px 0px no-repeat rgb(250, 247, 239); border: 2px solid rgb(239, 239, 239); min-height: 35px; line-height: 1.6em; color: rgb(51, 51, 51); font-family: verdana, &quot;ms song&quot;, Arial, Helvetica, sans-serif; white-space: normal;"><p style="margin: 10px auto; padding: 0px;">&lt;Directory &quot;/home/domain/public_html&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Options -Indexes FollowSymLinks<br style="margin: 0px; padding: 0px;"/>AllowOverride All<br style="margin: 0px; padding: 0px;"/>&lt;Files ~ &quot;.txt&quot;&gt;<br style="margin: 0px; padding: 0px;"/>Order allow,deny<br style="margin: 0px; padding: 0px;"/>Deny from all<br style="margin: 0px; padding: 0px;"/>&lt;/Files&gt;<br style="margin: 0px; padding: 0px;"/>&lt;/Directory&gt;</p></blockquote><p><br/></p>Tue, 19 Mar 2019 23:23:35 +0800海草房http://www.haicao.net/?id=13<p>&nbsp;</p><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">1.</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">启动至恢复系统:按住</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><span class="Apple-converted-space">&nbsp;</span>Command<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">和</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><span class="Apple-converted-space">&nbsp;</span>R<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">键的同时重新启动</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">Mac</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">2.</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">从</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">恢复</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">菜单栏中选取</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">实用工具</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”&gt;“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终端</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">3.“</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">终端</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">窗口显示后,从菜单栏中选取</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“Shell”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">,然后选取</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">新建窗口</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”,</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">再选择</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“basic&quot;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">那一项,来打开第二个</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终端</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">窗口。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">4.</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">在第一个</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终端</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">窗口中,键入以下命令:</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">diskutil cs list<span class="Apple-converted-space">&nbsp;</span></span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">回车</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-family: 宋体; word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">应会显示类似以下内容的列表:</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-family: 宋体; word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">例:</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">-- Logical Volume Group 9BDE693D-8B2A-4BB5-B2F2-AB836127C4FA<span class="Apple-converted-space">&nbsp;</span><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/>5.</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">拷贝第一行中的逻辑宗卷组用户</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">ID<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">号。</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">(</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">即:</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">group</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">后面的一串东西</span></span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">)<br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/>6.</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">在第二个</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终端</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">窗口中,键入以下命令:</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">diskutil cs delete LVG UUID<br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/></span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">注:将</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“LVGUUID”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">替换为您在上一步中记下的编号。例如:</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">diskutilcs delete 9BDE693D-8B2A-4BB5-B2F2-AB836127C4FA</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">直到看到</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">finish</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">或</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">operation</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">7.</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">选取</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终端</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”&gt;“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">退出</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">来返回到</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">&quot;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">OS</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">X实用工具</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">菜单。选择</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">磁盘工具</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">,选择左手白色框内第一个名称,看看右手边的五个选项是否全部显示正常了,不是要把</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">4-6</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">的步骤重新再做一次,直到见到五个选项显示正常为止。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/><br style="word-wrap: break-word;"/><span style="font-family: 宋体;">8.</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-family: 宋体; font-size: 11.5pt; word-wrap: break-word;">然后选取</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">“</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">重新安装</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">OS X”</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">,按照提示处理即可。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"></span></span></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">9</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">、由于我是混合万博man手机注册,这样就由一个混合万博man手机注册变成了</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">2</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">个物理万博man手机注册。需再次执行如下命令</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">Diskutil list&nbsp;&nbsp;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">回车</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">Diskutil unmountdisk disk0<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">回车</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">Diskutil zerodisk disk0&nbsp;&nbsp;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">回车</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">&nbsp; &nbsp;&nbsp;&nbsp;5</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">秒后</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">用</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">ctrl+c<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终止</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">Diskutil unmountdisk disk1&nbsp;&nbsp;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">回车</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">Diskutil zerodisk disk1&nbsp; &nbsp;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">回车</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">&nbsp; &nbsp;5</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">秒后</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">用</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">ctrl+c<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">终止</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"></span></span></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-family: 宋体; word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">关闭终端</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">&nbsp;&nbsp;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">回到磁盘工具界面</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-family: 宋体; word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">这时磁盘工具左边应该</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">2</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">个物理万博man手机注册为红字,点击一个会提示磁盘有问题,需修复,(如果未出现,重新启动,cmd+r,进入磁盘工具,就会出现)点击修复,完成后出现一个</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">internalhdd<span class="Apple-converted-space">&nbsp;</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">下面出现一个</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">M***&nbsp;&nbsp;hdd&nbsp;&nbsp;</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">再下面是原来的一个红色的物理万博man手机注册,点击出界面,但是修复不了,这没关系,退出磁盘工具,再次进去,混合万博man手机注册就已经好了。</span></span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"></span></span></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-family: 宋体; word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">就可以选择重新安装</span></span></span><span style="font-family: 宋体;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">os</span></span></span><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;">进行网络安装了,也可以做好u盘,通过u盘安装,这个网上很多教程。</span></span></span></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-family: 宋体; word-wrap: break-word;"><span style="font-size: 11.5pt; word-wrap: break-word;"><br style="word-wrap: break-word;"/></span></span></span></div><div style="font: 14px/28px 微软雅黑, Arial, HELVETICA; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(254, 254, 254); -webkit-text-stroke-width: 0px;" align="left"><span style="font-family: 宋体; word-wrap: break-word;"><span style="color: rgb(61, 61, 61); word-wrap: break-word;"><span style="font-size: 15px; word-wrap: break-word;">这个是我这几天总算搞清楚的事情,希望能让大家少走点弯路。</span></span></span></div><p></p>Sat, 28 May 2016 10:10:40 +0800海草房http://www.haicao.net/?id=12<p>力求以最简洁的文字来解决问题。</p><p><br/>4种方法,前提是万博man手机注册无锁,关于万博man手机注册加密,提示解锁万博man手机注册的,只能重装系统,请看本站另外一篇帖子。直接进入正题,:</p><p>&nbsp;</p><ul style="list-style-type: disc;" class=" list-paddingleft-2"><li><p>使用Apple ID重置用户账户密码</p></li><li><p>使用OS X安装光盘或者U盘来重置用户账户密码</p></li><li><p>新建一个管理员账户来更改原有用户账户密码</p></li><li><p>Recovery模式终端更改用户账户密码</p></li></ul><p><br/>一、使用Apple ID重置用户账户密码<br/>使用这个方法有一个前提</p><p>&nbsp;</p><p><br/>如上图红框,此项必须勾选,否则无法使用Apple ID重置密码。(如果你不记得有没有勾选,则你起码要记得首次启动 OS X 或装有 OS X Lion 或更高版本的全新 Mac 时,你会进入“OS X 设置助理”,其中需要你输入 Apple ID。输入 Apple ID 后,请在“创建您的帐户”阶段选择“允许我的 Apple ID 重设此用户的密码”选项。)<br/>好了,来说下具体实现的方法:<br/>如果您在登录窗口错误输入帐户密码三次,系统会显示一条信息,提示“如果忘记密码,您可以使用 Apple ID 重设密码”。点按圆圈中带箭头的图标以调出“重设密码”对话框。输入您的 Apple ID 和密码,然后点按“重设密码”以继续操作。<br/>在系统显示的通知您关于新钥匙串信息的对话框中,点按”好“。<br/>输入新密码、验证密码和密码提示字段,然后点按”重设密码“以继续操作。<br/>点按”继续登录“,使用刚创建的新密码完成登录。<br/>注:更改用户帐户密码将创建新的钥匙串。之前的钥匙串仍存在,且如果您以后记起之前的密码,可对其进行访问。</p><p>&nbsp;</p><p><br/>二、使用OS X安装光盘或者U盘来重置用户账户密码。<br/>插上U盘或者光盘,开机按住Option进入,进入后,先选择语言,在屏幕的上方会出现一个工具栏,在上面找到实用工具,在实用工具里面找到“重设密码”,进入后选择Mac OS X万博man手机注册宗卷,选择原始管理员账户的用户名。</p><p>&nbsp;</p><p><br/>如图,输完新密码,点储存,重启电脑即可。<br/>注:请勿选择“系统管理员 (root)”。此帐户实际上是 Root 用户。不要将其与普通管理员帐户混淆。</p><p><br/>三、新建一个管理员账户来更改原有用户账户密码<br/>开机,启动时按cmd+S,进入Single User Mode,在:/ root#下 输入 mount -uaw / 回车,<br/>完成后,输入rm -rf /var/db/.AppleSetupDone按下回车键,如果没有任何报错信息,则表明执行成功。<br/>输入reboot重新启动。你会发现,熟悉的初始界面又回来了,别担心,东西全没丢。就像第一次安装一样,重新建立一个新的管理员账号。在新的管理员下打开 用户与群组,打开最下面的锁,问密码时,用新的管理员的帐号的密码。你会看到至少两个账号,新的管理员的帐号和你原来的帐号,点中原来的账号,选择更改密码。 你不必有原先的密码就直接可以设新密码。<br/>点下面的登陆选项 ,自动登录选中你原先的账号,重启即可。<br/>OK,大功告成。如果你不喜欢机器多出一个账号,删除你新建的管理员账户。</p><p><br/>四、Recovery模式终端更改用户账户密码<br/>其实这个方法较前两个是比较简单方便的,实质就是进入Recovery来使用终端修改密码</p><p><br/>第一种方法:开机按CMD+R进入网络恢复模式,等待地球转,进度条读完,进入实用工具-终端-输入resetpassword就可以直接修改密码了。<br/>第二种方法:开机按住Option,进入Recovery(恢复),实用工具-终端-输入resetpassword修改密码。</p><p>&nbsp;</p><p>如果有用话的请支持!让更多人看到&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p>&nbsp;<br/></p><p>&nbsp;</p>Sat, 28 May 2016 09:56:14 +0800海草房http://www.haicao.net/?id=11<p>&nbsp;</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">mysql 进程在一个写入中被杀死、计算机意外关闭、硬件错误都能造成mysql表损坏 。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;"><strong>mysql 修复表的各种方法</strong></p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">1、mysqlcheck 进行表修复</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">使用mysqlcheck 命令对表进行修复</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">#mysqlcheck -uuser -ppassword database&nbsp; table&nbsp; -c&nbsp; #检查单个表是否损坏</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">#mysqlcheck -uuser -ppassword database&nbsp; -c&nbsp; #检查整个库那些表损坏</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">首先检查数据库的那些表损坏,如果能定位到那张表损坏可以直接对表修复</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">#mysqlcheck -uuser -ppassword database&nbsp; table&nbsp; -r # 修复数据表</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">#mysqlcheck -uuser -ppassword database&nbsp;&nbsp; -r # 修复整个数据库</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">更多参数 查看 mysqlcheck –help</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">2、myisamchk 修复mysql表</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;"><span style="color: rgb(0, 0, 0);">Myisamchk是MyISAM表维护的一个非常实用的工具。可以使用myisamchk实用程序来获得有关数据库表的信息或检查、修复、优化他们。myisamchk适用MyISAM表(对应.MYI和.MYD文件的表)。</span></p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;"><strong><span style="color: rgb(0, 0, 0);">Myisamchk</span><span class="Apple-converted-space">&nbsp;</span>选项解释</strong></p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–debug=debug_options, -# debug_options<br/>输出调试记录文件。debug_options字符串经常是’d:t:o,filename’。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–silent,-s<br/>沉默模式。仅当发生错误时写输出。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–wait, -w<br/>如果表被锁定,不是提示错误终止,而是在继续前等待到表被解锁。<br/>如果不使用–skip-external-locking,可以随时使用myisamchk来检查表。当检查表时,所有尝试更新表的客户端将等待,直到myisamchk准备好可以继续。<br/>请注意如果用–skip-external-locking选项运行mysqld,只能用另一个myisamchk命令锁定表。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–var_name=value<br/>可以通过–var_name=value选项设置下面的变量:</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–check, -c<br/>检查表的错误。如果你不明确指定操作类型选项,这就是默认操作。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–check-only-changed, -C<br/>只检查上次检查后有变更的表。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–extend-check, -e<br/>非常仔细地检查表。如果表有许多索引将会相当慢。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–fast,-F<br/>只检查没有正确关闭的表。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–force, -f<br/>如果myisamchk发现表内有任何错误,则自动进行修复。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–information, -i<br/>打印所检查表的统计信息。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–medium-check, -m<br/>比–extend-check更快速地进行检查。只能发现99.99%的错误</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–update-state, -U<br/>将信息保存在.MYI文件中,来表示表检查的时间以及是否表崩溃了。该选项用来充分利用–check-only-changed选项,<br/>但如果mysqld服务器正使用表并且正用–skip-external-locking选项运行时不应使用该选项。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–read-only, -T<br/>不要将表标记为已经检查。如果你使用myisamchk来检查正被其它应用程序使用而没有锁定的表很有用</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–backup, -B<br/>将.MYD文件备份为file_name-time.BAK</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–character-sets-dir=path<br/>字符集安装目录。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–correct-checksum<br/>纠正表的校验和信息。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–data-file-length=len, -D len<br/>数据文件的最大长度</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–extend-check,-e<br/>进行修复,试图从数据文件恢复每一行。一般情况会发现大量的垃圾行。不要使用该选项,除非你不顾后果。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–force, -f<br/>覆盖旧的中间文件(文件名类似tbl_name.TMD),而不是中断</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–keys-used=val, -k val<br/>对于myisamchk,该选项值为位值,说明要更新的索引。选项值的每一个二进制位对应表的一个索引,其中第一个索引对应位0。<br/>选项值0禁用对所有索引的更新,可以保证快速插入。通过myisamchk -r可以重新激活被禁用的索引。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–parallel-recover, -p<br/>与-r和-n的用法相同,但使用不同的线程并行创建所有键。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–quick,-q<br/>不修改数据文件,快速进行修复。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–recover, -r<br/>可以修复几乎所有一切问题,除非唯一的键不唯一时(对于MyISAM表,这是非常不可能的情况)。如果你想要恢复表,<br/>这是首先要尝试的选项。如果myisamchk报告表不能用-r恢复,则只能尝试-o。<br/>在不太可能的情况下-r失败,数据文件保持完好)。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–safe-recover, -o<br/>使用一个老的恢复方法读取,按顺序读取所有行,并根据找到的行更新所有索引树。这比-r慢些,<br/>但是能处理-r不能处理的情况。该恢复方法使用的万博man手机注册空间比-r少。一般情况,你应首先用-r维修,如果-r失败则用-o。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–sort-recover, -n<br/>强制myisamchk通过排序来解析键值,即使临时文件将可能很大。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–analyze,-a<br/>分析键值的分布。这通过让联结优化器更好地选择表应该以什么次序联结和应该使用哪个键来改进联结性能。<br/>要想获取分布相关信息,使用myisamchk –description –verbose tbl_name命令或SHOW KEYS FROM tbl_name语句。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–sort-index, -S<br/>以从高到低的顺序排序索引树块。这将优化搜寻并且将使按键值的表扫描更快。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–set-auto-increment[=value], -A[value]<br/>强制从给定值开始的新记录使用AUTO_INCREMENT编号(或如果已经有AUTO_INCREMENT值大小的记录,应使用更高值)。<br/>如果未指定value,新记录的AUTO_INCREMENT编号应使用当前表的最大值加上1。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">–description, -d<br/>打印出关于表的描述性信息。</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">检查表</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">[root@nagios test]# myisamchk -e wpusers.MYI<br/>Checking MyISAM file: wpusers.MYI<br/>Data records:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp; Deleted blocks:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br/>- check file-size<br/>- check record delete-chain<br/>- check key delete-chain<br/>- check index reference<br/>- check data record references index: 1<br/>- check data record references index: 2<br/>- check data record references index: 3<br/>- check records and index references</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">myisanchk修复表</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">[root@nagios test]# myisamchk -r wpusers.MYI<br/>- recovering (with sort) MyISAM-table ‘wpusers.MYI’<br/>Data records: 1<br/>- Fixing index 1<br/>- Fixing index 2<br/>- Fixing index 3</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">3、自动修复mysql 表脚本</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">#!/bin/bash<br/>#This script edit by badboy connect leezhenhua17@163.com<br/>#This script used by repair tables<br/>mysql_host=localhost<br/>mysql_user=root<br/>mysql_pass=123456<br/>database=test</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">tables=$(mysql -h$mysql_host -u$mysql_user -p$mysql_pass $database -A -Bse “show tables”)<br/>for arg in $tables<br/>do<br/>check_status=$(mysql -h$mysql_host -u$mysql_user -p$mysql_pass $database -A -Bse “check table $arg” | awk ‘{ print $4 }’)<br/>if [ &quot;$check_status&quot; = &quot;OK&quot; ]<br/>then<br/>echo “$arg is ok”<br/>else<br/>echo $(mysql -h$mysql_host -u$mysql_user -p$mysql_pass $database -A -Bse “repair table $arg”)</p><p style="font: 13px/19px verdana, Arial, helvetica, sans-seriff; margin: 10px auto; text-align: left; color: rgb(75, 75, 75); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">fi<br/>echo $(mysql -h$mysql_host -u$mysql_user -p$mysql_pass $database -A -Bse “optimize table $arg”)<br/>done</p><p></p>Mon, 07 Mar 2016 09:56:11 +0800海草房http://www.haicao.net/?id=10<p><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;"></strong>&nbsp;</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">90后的员工和富二代、娱乐圈,并称朋友圈三宝,因为他们总是说走就走了,老板们哭着喊着给他们加薪升职,却也只能看到他们的背影和扬起的尘土。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">其实钱、工作环境这些因素只能让他们“没有不满意”,并不能让他们感到“满意”。满意只能来自于工作本身,和已经得到满足的需求。一个人的需求很多样化,有五层,满足的难易程度不同,而当每一层的需要得到满足之后,就很难起到任何的激励作用了。所以对超级多元化的90后员工,老板们还是得用不同的激励手段。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text"><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">没有不满意,不代表一定喜欢啊</strong></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">小甄是小巴的朋友,一位80后的尾巴,本科毕业之后就在一线城市的一家互联网创业公司工作。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">毕业三年后第一次同学会上,别人就发现他的名片头衔上已经带上了“总”字。有相熟的同学半开玩笑地说以后要照应兄弟们。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">去年年底,他在微信上公告已卖掉期权,从工作了五六年的公司辞职了。前段时间,他旅游路过杭州,顺道来看我,便聊起了近况。他上半年一直在装修新房子,自己设计、自己买材料、自己做监工,现在一切完毕后出来旅游放个假。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">小甄突然离职,且并非被别家挖走,只是单纯地离职在家赋闲,总归让人有一些不解。我就问他为什么不干了?他的回答让我印象太深刻。</p><p style="margin: 0px 0px 20px; padding: 0px; text-align: center; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="image"></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">|<span class="Apple-converted-space">&nbsp;</span><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">为什么90后员工这么难留?</strong><span class="Apple-converted-space">&nbsp;</span>|</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">他的父母并不同意他辞职,问他“这么好的工作还有什么不满意的”,小甄的回答是<strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">“其实一切都很好,但是没有不满意并不等于一定满意。”</strong></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">在原来的公司收入很丰厚,岗位层次也不低,管理人性化,总体上办公室政治也在可控范围内。但他渐渐觉得这些应该是一个好公司的必要条件。要让他在工作上更有动力,还需要一些别的东西,他离职的前一年,似乎并没有感觉到。虽然公司的发展还是很快,但他每天在做的事情都变化不大,似乎和公司总体上的大局没有太大关系,有没有他其实不会有决定性的差别。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">小甄一直都希望有一套自己设计的房子,正好去年年底房价低,就在市区买了一套大户型,辞职全身心投入到房子的装修设计中去了。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">说起房子,他手舞足蹈地给我比划结构,一本正经地给我科普:家里第一重要的玄关要怎么设计、客厅大的话顶灯要选择什么样式、如果在家里安置一面书墙应该放在哪里比较好、阳台上其实可以铺一部分鹅卵石,还拿出手机不停地展示这个他最钟情的“产品”。整个装修过程中他都全情投入,有时候每天要花十几个小时,甚至比此前的工作时间还要长。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">看得出来,这是他喜欢的事情,也让他很满足,他说:“装修房子特别好玩,住自己设计的房子这个做法特别酷,以后也许就在这个方面创业,把它作为未来的事业”。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">报酬待遇、上司的监督、人际关系、工作环境,这些和工作内容本身没有太大关系的物质利益和工作条件等,在工作中属于<strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">“保健性因素”</strong>。如果工作中这些条件没有被满足,员工很容易产生不满。任何一个企业要想安抚员工,维持工作水平,就必须让这些因素维持在使员工满意的水平。不过这些因素只能消除不满意,却不能激励员工更热爱这份事业。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">而激发员工工作意愿,自发自愿地“喜欢”一项工作的元素,来自于工作内容本身,属于<strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">“激励性因素”</strong>。这些条件包括:成就感、赏识和褒奖、工作内容本身、责任、升迁和发展等。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">在一个快速成长的行业,激励性因素显然不会是稀缺事物,但却可能经常被忽略。很多时候管理者仅仅依靠保健性因素来作为激励手段,而对于工作本身并没有提供激励,才会出现小甄这种“钱给够了,但是心还是委屈了”的离职。</p><p style="margin: 0px 0px 20px; padding: 0px; text-align: center; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="image"></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">|<span class="Apple-converted-space">&nbsp;</span><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">90后需要“激励性因素”更甚于“保健型因素”</strong><span class="Apple-converted-space">&nbsp;</span>|</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text"><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">“员工以客户为上帝,管理以员工为上帝”</strong></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">老叶是一家精品酒店的老板,是一位70后的老酒店人,在多家五星级酒店担任了多年的管理层。现在他手下带领着一个几乎由清一色90后 “小朋友”组成的团队,少数的几位80后高管镶嵌在其中。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">在几个旅游网站上,他的酒店评分都是本地最高的,接近满分,看评语似乎有很多回头客,除了酒店的环境很好之外,主要的原因大概是“服务真的很好”、“酒店的员工很周到”。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">老叶说服务业终究还是人的行业,一开始他觉得自己有很多年的酒店从业经验,从“顾客是上帝”这一点出发,把服务做好,后面的一切都有了。但是年轻人的世界不太一样,他走了一段弯路。最后发现,他还是要先把员工们伺候好了,然后员工们才能把顾客当成是上帝。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">他告诉我<strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">“90后和90后也是不一样的”</strong>。不同的岗位和员工类型上,也需要用不同的激励手段。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">服务中心的一线员工,比如前台和服务员,工作本身是一套流程,而不是高深的专业技能。他们工资不高,因为在这个岗位上酒店付不起太高的工资。所以需要对他们进行额外的非物质激励,给予他们被重视的感觉。老叶采取过一些老式方法,比如通过业绩光荣榜来展现对优质员工的重视、经常采取态度真诚的口头表扬,效果也都不错。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">不过效果最好的办法是给一线员工授权,让他们在解决顾客的实际问题时拥有更多的自主权。服务中心距离顾客最近,所以他把服务中心设置成资源调配中心,有权力调动包括客房、厨房等其他部门的资源,并在考核上加以参考。除此之外,前台员工可以直接调用一夜间房费以内的费用,事后报备,比如某位新入住的顾客,正好是生日,订一个蛋糕还是鲜花,完全由一线员工决定。</p><p style="margin: 0px 0px 20px; padding: 0px; text-align: center; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="image"></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">|<span class="Apple-converted-space">&nbsp;</span><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">不少<strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">公司</strong></strong><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">让年轻员工自己设计办公场所</strong><span class="Apple-converted-space">&nbsp;</span>|</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">而酒店的微信订阅号做得不错,负责的是一位从媒体界挖来的90后编辑,虽然年轻,但也是资深的专业人员,忠于自己的专业技能甚于雇主。所以老叶给他安排了很多具有挑战性的目标,又让他自主决定如何处理,还定期慰问表达支持与鼓励,关心他的工作存在什么问题,是否需要支持,以表达对他的工作不仅感兴趣而且很看重。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">还有一些是兼职的实习生和试用期的员工,他们在工作安全感和稳定性上欠佳,福利待遇上也有所不如。所以相应的激励因素就是提供转正的机会,以及提供一些职业技能培训的课程。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">在行为科学上具有划时代意义的心理学家亚伯拉罕·马斯洛将人类的需要分为了五层,分别是:</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">1)生存和生理需求</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">2)安全需求</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">3)情感和归属的需求</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">4)尊重的需求</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">5)自我实现的需求</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">当每一层的需要得到满足之后,就很难起到任何的激励作用了。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">很显然,相较于长辈和前辈们,90后成长于殷实的年代,生存和生理上的、安全的两层需要被轻易满足,所以基于此的薪酬、稳定等因素已经失效了。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text"><strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">社交上的认可、他人和自我的尊重、以及一种自我成就感,才是需要优先考虑的。</strong>如果一份工作不能拿出去在朋友圈晒、如果工作成果不能让顾客和老板真诚表扬、如果由于公司或者上司的支持力度不够而不能做到最好,那么这份工作对于他们的激励是远远不够的。</p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">而最终的激励一定来自于自我的实现和超越,对于此,马斯洛在他的专著《动机与人格》中写到<strong style="margin: 0px; padding: 0px; line-height: inherit; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: 800; vertical-align: baseline; -webkit-font-smoothing: antialiased;">“的确,自我实现的人,那些已达到成熟、健康和自我满足的高层次的人们,他们有如此多的东西可以教给我们,以至于有时他们几乎就像是人类中的一个不同的种类。”</strong></p><p style="font: 14px/24px arial, &quot;Hiragino Sans GB&quot;, 微软雅黑, MicrosoftYaHei, 宋体, 宋体, Tahoma, Arial, Helvetica, STHeiti; margin: 25px 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 28px; letter-spacing: 0.5px; word-spacing: 0px; vertical-align: baseline; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px; -webkit-font-smoothing: antialiased;" class="text">90后员工的老板们最好能理解并做到这一点,并用心为此提供一切帮助,否则他们一定会用脚惩罚你们。</p><p></p>Tue, 13 Oct 2015 08:54:55 +0800海草房http://www.haicao.net/?id=9<p>&nbsp;php获取远程图片的两种:CURL方式和sockets方式获取远程图片,</p><p>方式1:sockets <br/></p><div class="codetitle"><a style="cursor: pointer;" id="copybut41863" class="copybut" data="41863"><span style="text-decoration: underline;">复制代码</span></a> 代码如下:</div><div id="code41863" class="codebody"><br/>$a = &quot;http://jb51.net/content/uploadfile/201106/thum-f3ccdd27d2000e3f9255a7e3e2c4880020110622095243.jpg&quot;; <br/>$local = &#39;socket1.gif&#39;; <br/>$aa = getImg($a,$local); <br/>/* <br/>*@ 完整的图片地址 <br/>*@ 要存储的文件名 <br/>*/ <br/>function getImg( $url = &quot;&quot;, $filename = &quot;&quot; ) { <br/>if(is_dir(basename($filename))) { <br/>echo &quot;The Dir was not exits&quot;; <br/>Return false; <br/>} <br/>//去除URL连接上面可能的引号 <br/>$url = preg_replace( &#39;/(?:^[\&#39;&quot;]+|[\&#39;&quot;\/]+$)/&#39;, &#39;&#39;, $url ); <br/>if (!extension_loaded(&#39;sockets&#39;)) return false; <br/>//获取url各相关信息 <br/>preg_match( &#39;/http:\/\/([^\/\:]+(\:\d{1,5})?)(.*)/i&#39;, $url, $matches ); <br/>if (!$matches) return false; <br/>$sock = socket_create( AF_INET, SOCK_STREAM, SOL_TCP ); <br/>if ( !@socket_connect( $sock, $matches[1], $matches[2] ? substr($matches[2], 1 ) : 80 ) ) { <br/>return false; <br/>} <br/>//图片的相对地址 <br/>$msg = &#39;GET &#39; . $matches[3] . &quot; HTTP/1.1\r\n&quot;; <br/>//主机名称 <br/>$msg .= &#39;Host: &#39; . $matches[1] . &quot;\r\n&quot;; <br/>$msg .= &#39;Connection: Close&#39; . &quot;\r\n\r\n&quot;; <br/>socket_write( $sock, $msg ); <br/>$bin = &#39;&#39;; <br/>while ( $tmp = socket_read( $sock, 10 ) ) { <br/>$bin .= $tmp; <br/>$tmp = &#39;&#39;; <br/>} <br/>$bin = explode(&quot;\r\n\r\n&quot;, $bin); <br/>$img = $bin[1]; <br/>$h = fopen( $filename, &#39;wb&#39; ); <br/>$res = fwrite( $h, $img ) === false ? false : true; <br/>@socket_close( $sock ); <br/>Return $res; <br/>} <br/></div><p><br/>方式2:curl <br/></p><div class="codetitle"><a style="cursor: pointer;" id="copybut33577" class="copybut" data="33577"><span style="text-decoration: underline;">复制代码</span></a> 代码如下:</div><div id="code33577" class="codebody"><br/>&lt;?php <br/>$url = &quot;http://jb51.net/content/uploadfile/201106/thum-f3ccdd27d2000e3f9255a7e3e2c4880020110622095243.jpg&quot;; <br/>$filename = &#39;curl.gif&#39;; <br/>//http://jb51.net <br/>getImg($url, $filename); <br/>/* <br/>*@通过curl方式获取制定的图片到本地 <br/>*@ 完整的图片地址 <br/>*@ 要存储的文件名 <br/>*/ <br/>function getImg($url = &quot;&quot;, $filename = &quot;&quot;) { <br/>if(is_dir(basename($filename))) { <br/>echo &quot;The Dir was not exits&quot;; <br/>Return false; <br/>} <br/>//去除URL连接上面可能的引号 <br/>$url = preg_replace( &#39;/(?:^[\&#39;&quot;]+|[\&#39;&quot;\/]+$)/&#39;, &#39;&#39;, $url ); <br/>$hander = curl_init(); <br/>$fp = fopen($filename,&#39;wb&#39;); <br/>curl_setopt($hander,CURLOPT_URL,$url); <br/>curl_setopt($hander,CURLOPT_FILE,$fp); <br/>curl_setopt($hander,CURLOPT_HEADER,0); <br/>curl_setopt($hander,CURLOPT_FOLLOWLOCATION,1); <br/>//curl_setopt($hander,CURLOPT_RETURNTRANSFER,false);//以数据流的方式返回数据,当为false是直接显示出来 <br/>curl_setopt($hander,CURLOPT_TIMEOUT,60); <br/>/*$options = array( <br/>CURLOPT_URL=&gt; &#39;http://jb51.net/content/uploadfile/201106/thum-f3ccdd27d2000e3f9255a7e3e2c4880020110622095243.jpg&#39;, <br/>CURLOPT_FILE =&gt; $fp, <br/>CURLOPT_HEADER =&gt; 0, <br/>CURLOPT_FOLLOWLOCATION =&gt; 1, <br/>CURLOPT_TIMEOUT =&gt; 60 <br/>); <br/>curl_setopt_array($hander, $options); <br/>*/ <br/>curl_exec($hander); <br/>curl_close($hander); <br/>fclose($fp); <br/>Return true; <br/>} <br/>?&gt;</div><p></p>Fri, 11 Sep 2015 15:48:26 +0800海草房http://www.haicao.net/?id=8<p>&nbsp;</p><div style="border-style: none none dashed; font: 13px/22px 微软雅黑; list-style: none; margin: 0px 0px 5px; padding: 3px 6px; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; border-bottom-color: rgb(170, 170, 170); border-bottom-width: 1px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;" class="post_content_text"><p style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;">我们的PHP程序有时候需要定时执行,我们可以使用ignore_user_abort函数或是在页面放置js让用户帮我们实现。但这两种方法都不太可靠,不稳定。我们可以借助<a style="list-style: none; margin: 0px; padding: 0px; border: currentColor; color: rgb(164, 0, 0); font-family: 微软雅黑; text-decoration: none; background-color: transparent;" href="https://www.centos.bz/tag/linux/">Linux</a>的<a rel="nofollow" style="list-style: none; margin: 0px; padding: 0px; border: currentColor; color: rgb(164, 0, 0); font-family: 微软雅黑; text-decoration: none; background-color: transparent;" href="https://www.centos.bz/tag/crontab/">Crontab</a>工具来稳定可靠地触发PHP执行任务。<br/>下面介绍Crontab的两种方法。<br/><span rel="nofollow" style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;" id="more-965"></span></p><h3 style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;" id="一、在Crontab中使用PHP执行脚本">一、在Crontab中使用PHP执行脚本</h3><p style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;">就像在Crontab中调用普通的<a style="list-style: none; margin: 0px; padding: 0px; border: currentColor; color: rgb(164, 0, 0); font-family: 微软雅黑; text-decoration: none; background-color: transparent;" href="https://www.centos.bz/category/shell/">shell</a>脚本一样(<a rel="nofollow" style="list-style: none; margin: 0px; padding: 0px; border: currentColor; color: rgb(164, 0, 0); font-family: 微软雅黑; text-decoration: none; background-color: transparent;" title="定时自动启动任务crontab命令用法" href="https://www.centos.bz/2011/03/auto-run-task-crontab/">具体Crontab用法</a>),使用PHP程序来调用PHP脚本。<br/>每一小时执行myscript.php如下:</p><div rel="nofollow" style="list-style: none; margin: 0px 0px 5px; padding: 0px; border: 1px solid rgb(195, 206, 217); width: auto; height: auto; text-align: left; overflow: auto; font-family: Fixedsys, &quot;BitStream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; background-color: rgb(249, 251, 252);" class="hl-surround"><ol style="list-style-type: decimal;" class="hl-main ln-show list-paddingleft-2" title="Double click to hide line number." ondblclick="linenumber(this)"><li><p># crontab -e</p></li><li><p>00 * * * * /usr/local/bin/php /home/john/myscript.php</p></li></ol></div><p style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;">/usr/local/bin/php为PHP程序的路径。</p><h3 style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;" id="二、在Crontab中使用URL执行脚本">二、在Crontab中使用URL执行脚本</h3><p style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;">如果你的PHP脚本可以通过URL触发,你可以使用lynx或curl或wget来配置你的Crontab。<br/>下面的例子是使用Lynx文本浏览器访问URL来每小时执行PHP脚本。Lynx文本浏览器默认使用对话方式打开URL。但是,像下面的,我们在lynx命令行中使用-dump选项来把URL的输出转换来标准输出。</p><div style="list-style: none; margin: 0px 0px 5px; padding: 0px; border: 1px solid rgb(195, 206, 217); width: auto; height: auto; text-align: left; overflow: auto; font-family: Fixedsys, &quot;BitStream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; background-color: rgb(249, 251, 252);" class="hl-surround"><ol style="list-style-type: decimal;" class="hl-main ln-show list-paddingleft-2" title="Double click to hide line number." ondblclick="linenumber(this)"><li><p>00 * * * * lynx -dump https://www.centos.bz/myscript.php</p></li></ol></div><p style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;">下面的例子是使用CURL访问URL来每5分执行PHP脚本。Curl默认在标准输出显示输出。使用&quot;curl -o&quot;选项,你也可以把脚本的输出转储到临时文件。</p><div style="list-style: none; margin: 0px 0px 5px; padding: 0px; border: 1px solid rgb(195, 206, 217); width: auto; height: auto; text-align: left; overflow: auto; font-family: Fixedsys, &quot;BitStream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; background-color: rgb(249, 251, 252);" class="hl-surround"><ol style="list-style-type: decimal;" class="hl-main ln-show list-paddingleft-2" title="Double click to hide line number." ondblclick="linenumber(this)"><li><p>*/5 * * * * /usr/bin/curl -o temp.txt https://www.centos.bz/myscript.php</p></li></ol></div><p style="list-style: none; margin: 0px; padding: 0px; border: currentColor; font-family: 微软雅黑; background-color: transparent;">下面的例子是使用WGET访问URL来每10分执行PHP脚本。-q选项表示安静模式。&quot;-O temp.txt&quot;表示输出会发送到临时文件。</p><div style="list-style: none; margin: 0px 0px 5px; padding: 0px; border: 1px solid rgb(195, 206, 217); width: auto; height: auto; text-align: left; overflow: auto; font-family: Fixedsys, &quot;BitStream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; background-color: rgb(249, 251, 252);" class="hl-surround"><ol style="list-style-type: decimal;" class="hl-main ln-show list-paddingleft-2" title="Double click to hide line number." ondblclick="linenumber(this)"><li><p>*/10 * * * * /usr/bin/wget -q -O temp.txt https://www.centos.bz/myscript.php</p></li></ol></div><div style="list-style: none; margin: 0px; padding: 0px; border: currentColor; height: 0px; overflow: hidden; clear: both; font-family: 微软雅黑; background-color: transparent;" class="clearfix"></div></div><p style="font: 12px/22px 微软雅黑; list-style: none; margin: 0px; padding: 0px; border: currentColor; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;"><a style="list-style: none; margin: 0px; padding: 0px; border: currentColor; color: rgb(164, 0, 0); font-family: 微软雅黑; text-decoration: none; background-color: transparent;" href="https://www.centos.bz/2011/07/php-cron-job-linux-crontab/">https://www.centos.bz/2011/07/php-cron-job-linux-crontab/</a></p><p></p>Sun, 07 Jun 2015 21:26:18 +0800海草房http://www.haicao.net/?id=7<p>&nbsp;</p><p 0px="" lucida="" microsoft="">CSS实现广告在ManBetX万博全站app中间显示,先贴上代码,再来说明:</p><p></p><pre class="prettyprint linenums bush:css" title="双击全选代码!" 0px="" solid="" 1px="" courier=""><ol style="list-style-type: decimal-leading-zero;" class=" list-paddingleft-2"><li><p><span style="color: rgb(102, 0, 102);">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span></p></li><li><p><span style="color: rgb(102, 0, 102);">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;html</span> <span style="color: rgb(102, 0, 102);">xmlns</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;head&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;meta</span> <span style="color: rgb(102, 0, 102);">http-equiv</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;Content-Type&quot;</span> <span style="color: rgb(102, 0, 102);">content</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;text/html; charset=utf-8&quot;</span> <span style="color: rgb(0, 0, 136);">/&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;title&gt;</span><span style="color: rgb(0, 0, 0);">http://www.phpddt.com提供</span><span style="color: rgb(0, 0, 136);">&lt;/title&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;meta</span> <span style="color: rgb(102, 0, 102);">name</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;keywords&quot;</span> <span style="color: rgb(102, 0, 102);">content</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;css,clear,ggad,文字环绕&quot;</span> <span style="color: rgb(0, 0, 136);">/&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;body&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;div</span> <span style="color: rgb(102, 0, 102);">style</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;</span><span style="color: rgb(0, 0, 136);">float</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 0, 0);">left</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 136, 0);">&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;div</span> <span style="color: rgb(102, 0, 102);">style</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;</span><span style="color: rgb(0, 0, 136);">float</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 0, 0);">left</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 0, 0);">height</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 102, 102);">60px</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 0, 0);">width</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 102, 102);">1px</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 136, 0);">&quot;</span><span style="color: rgb(0, 0, 136);">&gt;&lt;/div&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;div</span> <span style="color: rgb(102, 0, 102);">style</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;</span><span style="color: rgb(0, 0, 136);">float</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 0, 0);">left</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 0, 0);">height</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 102, 102);">200px</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 0, 0);">width</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 102, 102);">200px</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 0, 0);">clear</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 0, 0);">left</span><span style="color: rgb(102, 102, 0);">;</span><span style="color: rgb(0, 0, 0);">background</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(136, 0, 0);">#ccc;margin:15px 15px;</span><span style="color: rgb(0, 136, 0);">&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 0);">这里放相应的广告代码,</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/div&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 0);">REST 描述了一个架构样式的互联系统(如 Web 应用程序)。REST 约束条件作为一个整体应用时,将生成一个简单、可扩展、有效、安全、可靠的架构。由于它简便、轻量级以及通过 HTTP 直接传输数据的特性,Restful WebService成为基于 SOAP 服务(可能会遇到性能问题)的一个最有前途的替代方案。用于 web 服务和动态 Web 应用程序的多层架构可以实现可重用性、简单性、可扩展性和组件可响应性的清晰分离。Ajax 和 Restful WebService本质上是互为补充的。开发人员可以轻松使用 Ajax 和 RESTful Web 服务一起创建丰富的界面。</span></p></li><li><p><span style="color: rgb(0, 0, 0);">目前主流 Web 2.0 服务提供者(包括 Yahoo、Google 和 Facebook)都对 REST 的采用,放弃基于 SOAP 和 WSDL 的接口。</span></p></li><li><p><span style="color: rgb(0, 0, 0);">Rest Webservice遵循四个基本设计原则:</span></p></li><li><p><span style="color: rgb(0, 0, 0);">显式地使用 HTTP 方法。</span></p></li><li><p><span style="color: rgb(0, 0, 0);">无状态。</span></p></li><li><p><span style="color: rgb(0, 0, 0);">公开目录结构式的 URI。</span></p></li><li><p><span style="color: rgb(0, 0, 0);">传输 XML、JavaScript Object Notation (JSON),或同时传输这两者。</span></p></li><li><p><span style="color: rgb(0, 0, 0);">&nbsp;</span></p></li><li><p><span style="color: rgb(0, 0, 0);">通过基于 REST 的 API 公开系统资源是一种灵活的方法,可以为不同种类的应用程序提供以标准方式格式化的数据。 可以帮助满足集成需求,并帮助将基于 REST 的基本服务集扩展或构建为更大的集合。 </span></p></li><li><p><span style="color: rgb(0, 0, 0);">转载请注明地址: http://www.phpddt.com/reprint/restful-webservice.html 尊重他人劳动成果就是尊重自己!</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/div&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/body&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/html&gt;</span></p></li></ol></pre><p></p><p 0px="" lucida="" microsoft="">效果图如下:</p><p 0px="" lucida="" microsoft=""><img title="201505221432263692138636.png" alt="4257916657.png" src="http://www.haicao.net/zb_users/upload/2015/05/201505221432263692138636.png"/></p><p 0px="" lucida="" microsoft="">说明:</p><p 0px="" lucida="" microsoft="">1.首先上面建立了一个width:1px的空白层来控制广告的位置。</p><p 0px="" lucida="" microsoft="">2.巧妙使用clear:left实现清楚左浮动,广告位下移。</p><p>&nbsp;</p>Fri, 22 May 2015 11:00:19 +0800海草房http://www.haicao.net/?id=6<p>&nbsp;</p><p 0px="" lucida="" microsoft="" auto="" 10px=""><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">AjaxFileUpload实现文件异步上传效果更好,使用简单:<br/></span></span></p><p><br lucida="" microsoft=""/></p><pre class="prettyprint linenums bush:xml" title="双击全选代码!" 0px="" solid="" 1px="" courier=""><ol style="list-style-type: decimal-leading-zero;" class=" list-paddingleft-2"><li><p><span style="color: rgb(102, 0, 102);">&lt;!DOCTYPE html&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;html&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;head&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;title&gt;&lt;/title&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;meta</span> <span style="color: rgb(102, 0, 102);">http-equiv</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;Content-Type&quot;</span> <span style="color: rgb(102, 0, 102);">content</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;text/html; charset=UTF-8&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;script</span> <span style="color: rgb(102, 0, 102);">type</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;text/javascript&quot;</span> <span style="color: rgb(102, 0, 102);">src</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;http://www.phpddt.com/usr/themes/dddefault/jquery-1.4.2.min.js&quot;</span><span style="color: rgb(0, 0, 136);">&gt;&lt;/script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;script</span> <span style="color: rgb(102, 0, 102);">type</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;text/javascript&quot;</span> <span style="color: rgb(102, 0, 102);">src</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;ajaxfileupload.js&quot;</span><span style="color: rgb(0, 0, 136);">&gt;&lt;/script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/head&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 0);">jQuery</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(){</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp;$</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 136, 0);">&quot;#buttonUpload&quot;</span><span style="color: rgb(102, 102, 0);">).</span><span style="color: rgb(0, 0, 0);">click</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(){</span></p></li><li><p><span style="color: rgb(136, 0, 0);">//加载图标 &nbsp; </span></p></li><li><p><span style="color: rgb(136, 0, 0);">/* $(&quot;#loading&quot;).ajaxStart(function(){</span></p></li><li><p><span style="color: rgb(136, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;$(this).show();</span></p></li><li><p><span style="color: rgb(136, 0, 0);"> &nbsp; &nbsp; }).ajaxComplete(function(){</span></p></li><li><p><span style="color: rgb(136, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;$(this).hide();</span></p></li><li><p><span style="color: rgb(136, 0, 0);"> &nbsp; &nbsp; });*/</span></p></li><li><p><span style="color: rgb(136, 0, 0);">//上传文件</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp;$</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">ajaxFileUpload</span><span style="color: rgb(102, 102, 0);">({</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;url</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&#39;upload.php&#39;</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(136, 0, 0);">//处理图片脚本</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;secureuri </span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 0, 136);">false</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;fileElementId </span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&#39;fileToUpload&#39;</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(136, 0, 0);">//file控件id</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;dataType </span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&#39;json&#39;</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;success </span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 0, 136);">function</span> <span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);"> status</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 136);">if</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 136);">typeof</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">error</span><span style="color: rgb(102, 102, 0);">)</span> <span style="color: rgb(102, 102, 0);">!=</span> <span style="color: rgb(0, 136, 0);">&#39;undefined&#39;</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 136);">if</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">error </span><span style="color: rgb(102, 102, 0);">!=</span> <span style="color: rgb(0, 136, 0);">&#39;&#39;</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">error</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span><span style="color: rgb(0, 0, 136);">else</span><span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;error</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);"> status</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);"> e</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">e</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">})</span></p></li><li><p><span style="color: rgb(0, 0, 136);">return</span> <span style="color: rgb(0, 0, 136);">false</span><span style="color: rgb(102, 102, 0);">;</span></p></li><li><p><span style="color: rgb(102, 102, 0);">})</span></p></li><li><p><span style="color: rgb(102, 102, 0);">})</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;body&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;input</span> <span style="color: rgb(102, 0, 102);">id</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;fileToUpload&quot;</span> <span style="color: rgb(102, 0, 102);">type</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;file&quot;</span> <span style="color: rgb(102, 0, 102);">size</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;20&quot;</span> <span style="color: rgb(102, 0, 102);">name</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;fileToUpload&quot;</span> <span style="color: rgb(102, 0, 102);">class</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;input&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;button</span> <span style="color: rgb(102, 0, 102);">id</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;buttonUpload&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span><span style="color: rgb(0, 0, 0);">上传</span><span style="color: rgb(0, 0, 136);">&lt;/button&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/body&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/html&gt;</span></p></li></ol></pre><p><br lucida="" microsoft=""/></p><p 0px="" lucida="" microsoft="" auto="" 10px=""><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">上传还可以传递参数:<br/></span></span></p><p><br lucida="" microsoft=""/></p><pre class="prettyprint linenums bush:jscript" title="双击全选代码!" 0px="" solid="" 1px="" courier=""><ol style="list-style-type: decimal-leading-zero;" class=" list-paddingleft-2"><li><p><span style="color: rgb(0, 0, 136);">var</span><span style="color: rgb(0, 0, 0);"> data </span><span style="color: rgb(102, 102, 0);">=</span> <span style="color: rgb(102, 102, 0);">{</span><span style="color: rgb(0, 0, 0);"> name</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&#39;my name&#39;</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);"> description</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&#39;short description&#39;</span> <span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp;$</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">ajaxFileUpload</span><span style="color: rgb(102, 102, 0);">({</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;url</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&#39;upload.php&#39;</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;secureuri</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 0, 136);">false</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;data</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 0, 0);"> data</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;fileElementId</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&#39;fileToUpload&#39;</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;dataType</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&#39;json&#39;</span><span style="color: rgb(102, 102, 0);">,</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;success</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 0, 136);">function</span> <span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">)</span> <span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(0, 0, 0);">&nbsp;</span></p></li><li><p><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;error</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 0, 136);">function</span> <span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">data</span><span style="color: rgb(102, 102, 0);">)</span> <span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 136, 0);">&quot;error&quot;</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">});</span></p></li></ol></pre><p><br lucida="" microsoft=""/></p><p 0px="" lucida="" microsoft="" auto="" 10px=""><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">主要参数说明:<br/></span></span><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">1,url表示处理文件上传操作的文件路径,可以测试URL是否能在浏览器中直接访问,如上:upload.php</span></span><br/><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">2,fileElementId表示文件域ID,如上:fileToUpload</span></span><br/><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">3,secureuri是否启用安全提交,默认为false</span></span><br/><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">4,dataType数据数据,一般选json,javascript的原生态</span></span><br/><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">5,success提交成功后处理函数</span></span><br/><span style="color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 25px;">6,error提交失败处理函数</span></span></p><p style="font: 14px/25px Verdana, Arial, helvetica, sans-seriff; margin: 10px auto !important; padding: 0px; border: 0px currentColor; color: rgb(35, 35, 35); text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">需要了解相关的错误提示</p><p style="font: 14px/25px Verdana, Arial, helvetica, sans-seriff; margin: 10px auto !important; padding: 0px; border: 0px currentColor; color: rgb(35, 35, 35); text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">1,SyntaxError: missing ; before statement错误<br/>如果出现这个错误就需要检查url路径是否可以访问</p><p style="font: 14px/25px Verdana, Arial, helvetica, sans-seriff; margin: 10px auto !important; padding: 0px; border: 0px currentColor; color: rgb(35, 35, 35); text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">2,SyntaxError: syntax error错误<br/>如果出现这个错误就需要检查处理提交操作的PHP文件是否存在语法错误</p><p style="font: 14px/25px Verdana, Arial, helvetica, sans-seriff; margin: 10px auto !important; padding: 0px; border: 0px currentColor; color: rgb(35, 35, 35); text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">3,SyntaxError: invalid property id错误<br/>如果出现这个错误就需要检查属性ID是否存在</p><p style="font: 14px/25px Verdana, Arial, helvetica, sans-seriff; margin: 10px auto !important; padding: 0px; border: 0px currentColor; color: rgb(35, 35, 35); text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">4,SyntaxError: missing } in XML expression错误<br/>如果出现这个错误就需要检查文件域名称是否一致或不存在</p><p style="font: 14px/25px Verdana, Arial, helvetica, sans-seriff; margin: 10px auto !important; padding: 0px; border: 0px currentColor; color: rgb(35, 35, 35); text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">5,其它自定义错误<br/>大家可使用变量$error直接打印的方法检查各参数是否正确,比起上面这些无效的错误提示还是方便很多。<br/>提供下下载:&nbsp;<a style="color: rgb(66, 120, 136);" title="ajaxfileupload.rar" href="http://www.phpddt.com/usr/uploads/2013/10/2635611695.rar">ajaxfileupload.rar</a></p><p></p>Fri, 22 May 2015 10:58:57 +0800海草房http://www.haicao.net/?id=5<p>&nbsp;</p><p 0px="" lucida="" microsoft="">javascript是弱类型的语言,系统在遍历json数据是会自行判断数据类型进行排序,如下:<br/></p><pre class="prettyprint linenums bush:jscript" title="双击全选代码!" 0px="" solid="" 1px="" courier=""><ol style="list-style-type: decimal-leading-zero;" class="linenums list-paddingleft-2"><li><p><span style="color: rgb(0, 0, 136);">&lt;script</span> <span style="color: rgb(102, 0, 102);">src</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;jquery.js&quot;</span><span style="color: rgb(0, 0, 136);">&gt;&lt;/script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">var</span><span style="color: rgb(0, 0, 0);"> json1 </span><span style="color: rgb(102, 102, 0);">=</span> <span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 136, 0);">&quot;2&quot;</span><span style="color: rgb(102, 102, 0);">:{</span><span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&quot;第1条&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(0, 136, 0);">&quot;1&quot;</span><span style="color: rgb(102, 102, 0);">:{</span><span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&quot;第2条&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(0, 136, 0);">&quot;3&quot;</span><span style="color: rgb(102, 102, 0);">:{</span><span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&quot;第3条&quot;</span><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(0, 0, 136);">var</span><span style="color: rgb(0, 0, 0);"> json2 </span><span style="color: rgb(102, 102, 0);">=</span> <span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 136, 0);">&quot;2_str&quot;</span><span style="color: rgb(102, 102, 0);">:{</span><span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&quot;第1条&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(0, 136, 0);">&quot;1_str&quot;</span><span style="color: rgb(102, 102, 0);">:{</span><span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&quot;第2条&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(0, 136, 0);">&quot;3_str&quot;</span><span style="color: rgb(102, 102, 0);">:{</span><span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span><span style="color: rgb(0, 136, 0);">&quot;第3条&quot;</span><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(0, 0, 0);">$</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">each</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">json1</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);">item</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 136, 0);">&quot;:&quot;</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 0, 0);">item</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">});</span></p></li><li><p><span style="color: rgb(0, 0, 0);">&nbsp;</span></p></li><li><p><span style="color: rgb(0, 0, 0);">$</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">each</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">json2</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);">item</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 136, 0);">&quot;:&quot;</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 0, 0);">item</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">});</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/script&gt;</span></p></li></ol></pre><p><br lucida="" microsoft=""/><span lucida="" microsoft="" inline="">如何对json数据按照指定的排序方式进行排序:</span><br lucida="" microsoft=""/></p><pre class="prettyprint linenums bush:jscript" title="双击全选代码!" 0px="" solid="" 1px="" courier=""><ol style="list-style-type: decimal-leading-zero;" class="linenums list-paddingleft-2"><li><p><span style="color: rgb(0, 0, 136);">&lt;script</span> <span style="color: rgb(102, 0, 102);">src</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;jquery.js&quot;</span><span style="color: rgb(0, 0, 136);">&gt;&lt;/script&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;script</span> <span style="color: rgb(102, 0, 102);">type</span><span style="color: rgb(102, 102, 0);">=</span><span style="color: rgb(0, 136, 0);">&quot;text/javascript&quot;</span><span style="color: rgb(0, 0, 136);">&gt;</span></p></li><li><p><span style="color: rgb(0, 0, 136);">var</span><span style="color: rgb(0, 0, 0);"> json </span><span style="color: rgb(102, 102, 0);">=</span> <span style="color: rgb(102, 102, 0);">{</span><span style="color: rgb(0, 136, 0);">&quot;languages&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(102, 102, 0);">[</span></p></li><li><p><span style="color: rgb(102, 102, 0);">{</span><span style="color: rgb(0, 136, 0);">&quot;id&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;1&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;PHP&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;1&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(102, 102, 0);">{</span><span style="color: rgb(0, 136, 0);">&quot;id&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;2&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;JACSCRIPT&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;3&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(102, 102, 0);">{</span><span style="color: rgb(0, 136, 0);">&quot;id&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;3&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;PYTHON&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;4&quot;</span><span style="color: rgb(102, 102, 0);">},</span></p></li><li><p><span style="color: rgb(102, 102, 0);">{</span><span style="color: rgb(0, 136, 0);">&quot;id&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;4&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;name&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;NODE.JS&quot;</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(0, 136, 0);">&quot;2&quot;</span><span style="color: rgb(102, 102, 0);">}</span></p></li><li><p><span style="color: rgb(102, 102, 0);">]};</span></p></li><li><p><span style="color: rgb(0, 0, 0);">&nbsp;</span></p></li><li><p><span style="color: rgb(136, 0, 0);">//排序前</span></p></li><li><p><span style="color: rgb(0, 0, 0);">$</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">each</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">)</span> <span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 136, 0);">&quot; &nbsp;&quot;</span> <span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 136, 0);">&quot; &nbsp;sort:&quot;</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">sort</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">});</span></p></li><li><p><span style="color: rgb(0, 0, 0);">&nbsp;</span></p></li><li><p><span style="color: rgb(136, 0, 0);">//进行排序</span></p></li><li><p><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 136, 0);">&quot;languages&quot;</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">sort</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">a</span><span style="color: rgb(102, 102, 0);">,</span><span style="color: rgb(0, 0, 0);">b</span><span style="color: rgb(102, 102, 0);">){</span></p></li><li><p><span style="color: rgb(0, 0, 136);">return</span><span style="color: rgb(0, 0, 0);"> a</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">]</span> <span style="color: rgb(102, 102, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"> b</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">]</span> <span style="color: rgb(102, 102, 0);">?</span> <span style="color: rgb(0, 102, 102);">1</span> <span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">a</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">]</span> <span style="color: rgb(102, 102, 0);">==</span><span style="color: rgb(0, 0, 0);"> b</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 136, 0);">&quot;sort&quot;</span><span style="color: rgb(102, 102, 0);">]</span> <span style="color: rgb(102, 102, 0);">?</span> <span style="color: rgb(0, 102, 102);">0</span> <span style="color: rgb(102, 102, 0);">:</span> <span style="color: rgb(102, 102, 0);">-</span><span style="color: rgb(0, 102, 102);">1</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">});</span></p></li><li><p><span style="color: rgb(0, 0, 0);">&nbsp;</span></p></li><li><p><span style="color: rgb(136, 0, 0);">//排序后</span></p></li><li><p><span style="color: rgb(0, 0, 0);">$</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">each</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">,</span> <span style="color: rgb(0, 0, 136);">function</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">)</span> <span style="color: rgb(102, 102, 0);">{</span></p></li><li><p><span style="color: rgb(0, 0, 0);"> &nbsp; &nbsp;alert</span><span style="color: rgb(102, 102, 0);">(</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 136, 0);">&quot; &nbsp;&quot;</span> <span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">name</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 136, 0);">&quot; &nbsp;sort:&quot;</span><span style="color: rgb(102, 102, 0);">+</span><span style="color: rgb(0, 0, 0);">json</span><span style="color: rgb(102, 102, 0);">.</span><span style="color: rgb(0, 0, 0);">languages</span><span style="color: rgb(102, 102, 0);">[</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(102, 102, 0);">].</span><span style="color: rgb(0, 0, 0);">sort</span><span style="color: rgb(102, 102, 0);">);</span></p></li><li><p><span style="color: rgb(102, 102, 0);">});</span></p></li><li><p><span style="color: rgb(0, 0, 136);">&lt;/script&gt;</span></p></li></ol></pre><p><br lucida="" microsoft=""/><span lucida="" microsoft="" inline="">主要是利用javascript的sort方式将数据按照指定方式排序。</span></p><p></p>Fri, 22 May 2015 10:57:20 +0800