<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[怪石网络图书馆]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[本站为广大网友提供学习，欣赏音乐，搜集知识]]></description>
<link>http://hi.baidu.com/%B9%D6%CA%AF</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[比较ASP生成静态HTML文件的几种方法]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/54b4acfd3a7c271f09244df7.html]]></link>
        <description><![CDATA[
		
		<h1>比较ASP生成静态HTML文件的几种方法</h1>
<div class="times">2007-06-06 13:40:54 来源:中国站长站 作者:ating整理 【<a href=" :doZoom(16)">大</a> <a href=" :doZoom(14)">中</a> <a href=" :doZoom(12)">小</a>】 <a class="fsource" href="http://chinaz.com/Program/Asp/060EL92007.html#plshow">评论：<font color="#ff0000">8</font> 条</a></div>
<div class="content" >
<div class="shoucang">

  </div>
<p>将动态页面转换生成静态Html文件有许多好处，比如生成html网页有利于被搜索引擎收录（特别是对接受动态参数的页面）。前台访问时，脱离了数据访问,减轻对数据库访问的压力，加快网页打开速度。</p>
<p>当然，凡事有利必有弊，生成HTML页面无形中也耗费大量的磁盘空间以存放这些静态文件，在编辑页面过程中除读写数据库外，也要读写服务器磁盘，页面样式的改动必须重新生成全部HTML文件，等等。</p>
<p>像很多搜索引擎，都可以提交网站的页面地址列表，动态文件的收录问题已经不算是个问题了（如google sitemap）。得失就要自己衡量把握了，但无论如何，我们还是要懂得如何操作的。这里就引用一下别人的文章说明几种常见的生成思路，供大家参考参考。</p>
<p>1、下面这个例子直接利用FSO把html代码写入到文件中然后生成.html格式的文件 。这是最原始的，优点是简单，缺点是页面的修改不方便，我一般用到的地方是利用它生成整站参数文件。（通常网站如标题，名称等配置保存在数据库，我将它生成config.asp保存这些变量调用，避免频繁访问数据库）</p>
<p>
<table style="border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; width: 686px; border-bottom: #cccccc 1px dotted; height: 361px" cellspacing="0" cellpadding="6" width="686" align="center" border="0">
    <tbody>
        <tr>
            <td style="word-wrap: break-word" bgcolor="#fdfddf"><font color="#ff0000">以下为引用的内容：</font><br>
            <p>＜% <br>
            filename=&quot;test.htm&quot; <br>
            if request(&quot;body&quot;)＜&gt;&quot;&quot; then <br>
            set fso = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;) <br>
            set htmlwrite = fso.CreateTextFile(server.mappath(&quot;&quot;&amp;filename&amp;&quot;&quot;)) <br>
            htmlwrite.write &quot;＜html&gt;＜head&gt;＜title&gt;&quot; &amp; request.form(&quot;title&quot;) &amp; &quot;＜/title&gt;＜/head&gt;&quot; <br>
            htmlwrite.write &quot;＜body&gt;输出Title内容: &quot; &amp; request.form(&quot;title&quot;) &amp; &quot;＜br /&gt; 输出Body内容:&quot; &amp; request.form(&quot;body&quot;)&amp; &quot;＜/body&gt;＜/html&gt;&quot; <br>
            htmlwrite.close <br>
            set fout=nothing <br>
            set fso=nothing <br>
            end if <br>
            %&gt; <br>
            ＜form name=&quot;form&quot; method=&quot;post&quot; action=&quot;&quot;&gt; <br>
            ＜input name=&quot;title&quot; value=&quot;Title&quot; size=26&gt; <br>
            ＜br&gt; <br>
            ＜textarea name=&quot;body&quot;&gt;Body＜/textarea&gt; <br>
            ＜br&gt; <br>
            ＜br&gt; <br>
            ＜input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;生成html&quot;&gt; <br>
            ＜/form&gt;</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>2、但是按照上面的方法生成html文件非常不方便，第二种方法就是利用模板技术，将模板中特殊代码的值替换为从表单或是数据库字段中接受过来的值，完成模板功能，将最终替换过的所有模板代码生成HTML文件。这种技术采用得比较多，大部分的CMS都是使用这类方法。</p>
<p>
<table style="border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; width: 670px; border-bottom: #cccccc 1px dotted; height: 578px" cellspacing="0" cellpadding="6" width="670" align="center" border="0">
    <tbody>
        <tr>
            <td style="word-wrap: break-word" bgcolor="#fdfddf"><font color="#ff0000">以下为引用的内容：</font><br>
            <p>template.htm ' //模板文件 <br>
            ＜html&gt; <br>
            ＜head&gt; <br>
            ＜title&gt;$title$ by webjx.com＜/title&gt; <br>
            ＜/head&gt; <br>
            ＜body&gt; <br>
            $body$ <br>
            ＜/body&gt; <br>
            ＜/html&gt;<br>
            TestTemplate.asp '// 生成Html <br>
            ＜% <br>
            Dim fso,htmlwrite <br>
            Dim strTitle,strContent,strOut <br>
            '// 创建文件系统对象 <br>
            Set fso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;) <br>
            '// 打开网页模板文件，读取模板内容 <br>
            Set htmlwrite=fso.OpenTextFile(Server.MapPath(&quot;Template.htm&quot;)) <br>
            strOut=f.ReadAll <br>
            htmlwrite.close <br>
            strTitle=&quot;生成的网页标题&quot; <br>
            strContent=&quot;生成的网页内容&quot; <br>
            '// 用真实内容替换模板中的标记 <br>
            strOut=Replace(strOut,&quot;$title$&quot;,strTitle) <br>
            strOut=Replace(strOut,&quot;$body$&quot;,strContent) <br>
            '// 创建要生成的静态页 <br>
            Set htmlwrite=fso.CreateTextFile(Server.MapPath(&quot;test.htm&quot;),true) <br>
            '// 写入网页内容 <br>
            htmlwrite.WriteLine strOut <br>
            htmlwrite.close <br>
            Response.Write &quot;生成静态页成功！&quot; <br>
            '// 释放文件系统对象 <br>
            set htmlwrite=Nothing <br>
            set fso=Nothing <br>
            %&gt;</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>3、第三种方法就是用XMLHTTP获取动态页生成的HTML内容，再用ADODB.Stream或者Scripting.FileSystemObject保存成html文件。找到一段XMLHTTP生成Html的代码参考一下。</p>
<p>
<table style="border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; width: 664px; border-bottom: #cccccc 1px dotted; height: 717px" cellspacing="0" cellpadding="6" width="664" align="center" border="0">
    <tbody>
        <tr>
            <td style="word-wrap: break-word" bgcolor="#fdfddf"><font color="#ff0000">以下为引用的内容：</font><br>
            <p>＜% <br>
            '常用函数 <br>
            '1、输入url目标网页地址，返回值getHTTPPage是目标网页的html代码 <br>
            function getHTTPPage(url) <br>
            dim Http <br>
            set Http=server.createobject(&quot;MSXML2.XMLHTTP&quot;) <br>
            Http.open &quot;GET&quot;,url,false <br>
            Http.send() <br>
            if Http.readystate&lt;&gt;4 then <br>
            exit function <br>
            end if <br>
            getHTTPPage=bytesToBSTR(Http.responseBody,&quot;GB2312&quot;) <br>
            set http=nothing <br>
            if err.number&lt;&gt;0 then err.Clear <br>
            end function <br>
             <br>
            '2、转换乱玛，直接用xmlhttp调用有中文字符的网页得到的将是乱玛，可以通过adodb.stream组件进行转换 <br>
             <br>
            Function BytesToBstr(body,Cset) <br>
            dim objstream <br>
            set objstream = Server.CreateObject(&quot;adodb.stream&quot;) <br>
            objstream.Type = 1 <br>
            objstream.Mode =3 <br>
            objstream.Open <br>
            objstream.Write body <br>
            objstream.Position = 0 <br>
            objstream.Type = 2 <br>
            objstream.Charset = Cset <br>
            BytesToBstr = objstream.ReadText <br>
            objstream.Close <br>
            set objstream = nothing <br>
            End Function <br>
            txtURL=server.MapPath(&quot;../index.asp&quot;) <br>
            sText = getHTTPPage(txtURL) <br>
            Set FileObject=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;) <br>
            filename=&quot;../index.htm&quot; <br>
            Set openFile=FileObject.OpenTextfile(server.mapPath(filename),2,true) 'true为不存在自行建立 <br>
            openFile.writeline(sText) <br>
            Set OpenFile=nothing <br>
            %&gt; <br>
            ＜script&gt; <br>
            alert(&quot;静态网页生成完毕&quot;); <br>
            history.back(); <br>
            ＜/script&gt;</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>小结，这三种方式是比较常用的生成HTML文件方法，我个比较喜欢使用第三种方式，因为页面改动时非常方便，就算动态页改动多大都好，只要重新用XMLHTTP读取生成一次即可。</p>
</div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/54b4acfd3a7c271f09244df7.html#comment">查看评论</a>]]></description>
        <pubDate>2009-09-07  11:16</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/54b4acfd3a7c271f09244df7.html</guid>
</item>

<item>
        <title><![CDATA[ASP生成Html函数，不用模板]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/57e8f350d98630551138c242.html]]></link>
        <description><![CDATA[
		
		<div class="tit">ASP生成Html函数，不用模板</div>
<div class="date">2009年02月16日 星期一 上午 00:16</div>
<table style="table-layout: fixed; width: 100%">
    <tbody>
        <tr>
            <td>
            <div class="cnt" >
            <p>&lt;%<br>
            Function MakeHtml(strURL,strTo) <br>
            &nbsp;&nbsp;  on error resume next <br>
            &nbsp;&nbsp;  response.write &quot;开始生成静态页面...&quot; <br>
            &nbsp;&nbsp;  strHtml = GetPage(strURL) <br>
            &nbsp;&nbsp;&nbsp;  <br>
            &nbsp;&nbsp;  Set fs=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)<br>
            &nbsp;&nbsp;  '要存放的页面地址 <br>
            &nbsp;&nbsp;  strAddress=server.MapPath(strTo)<br>
            &nbsp;&nbsp;  '如果文件存在则删除旧文件<br>
            &nbsp;&nbsp;  If (fs.FileExists(strAddress)) Then fs.DeleteFile(strAddress) <br>
            &nbsp;&nbsp;&nbsp;  <br>
            &nbsp;&nbsp;  Set mHtml=fs.CreateTextFile(strAddress) <br>
            &nbsp;&nbsp;  mHtml.Writeline(strHtml) <br>
            &nbsp;&nbsp;  set mHtml=nothing <br>
            &nbsp;&nbsp;  set fs=nothing <br>
            &nbsp;&nbsp;  response.write &quot;...&lt;font color=red&gt;生成静态页面&lt;&quot;&amp;strTo&amp;&quot;&gt;成功！&lt;/font&gt;&quot;&nbsp;&nbsp;  <br>
            End Function</p>
            <p>'######获取要生成动态页地址######<br>
            Function GetPage(url) <br>
            &nbsp;&nbsp;&nbsp;  '获得文件内容 <br>
            &nbsp;&nbsp;&nbsp;  dim Retrieval <br>
            &nbsp;&nbsp;&nbsp;  Set Retrieval = CreateObject(&quot;Microsoft.XMLHTTP&quot;) <br>
            &nbsp;&nbsp;&nbsp;  With Retrieval <br>
            &nbsp;&nbsp;&nbsp;  .Open &quot;Get&quot;, url, False,&quot;&quot;, &quot;&quot; <br>
            &nbsp;&nbsp;&nbsp;  .Send <br>
            &nbsp;&nbsp;&nbsp;  GetPage = BytesToBstr(.ResponseBody) <br>
            &nbsp;&nbsp;&nbsp;  End With <br>
            &nbsp;&nbsp;&nbsp;  Set Retrieval = Nothing <br>
            End Function <br>
            <br>
            '######转换字符###### <br>
            Function BytesToBstr(body) <br>
            &nbsp;&nbsp;&nbsp;  dim objstream <br>
            &nbsp;&nbsp;&nbsp;  set objstream = Server.CreateObject(&quot;adodb.stream&quot;) <br>
            &nbsp;&nbsp;&nbsp;  objstream.Type = 1 <br>
            &nbsp;&nbsp;&nbsp;  objstream.Mode =3 <br>
            &nbsp;&nbsp;&nbsp;  objstream.Open <br>
            &nbsp;&nbsp;&nbsp;  objstream.Write body <br>
            &nbsp;&nbsp;&nbsp;  objstream.Position = 0 <br>
            &nbsp;&nbsp;&nbsp;  objstream.Type = 2 <br>
            &nbsp;&nbsp;&nbsp;  objstream.Charset = &quot;GBK&quot; <br>
            &nbsp;&nbsp;&nbsp;  BytesToBstr = objstream.ReadText <br>
            &nbsp;&nbsp;&nbsp;  objstream.Close <br>
            &nbsp;&nbsp;&nbsp;  set objstream = nothing <br>
            End Function <br>
            %&gt;</p>
            <p>保存为MakeHtml.inc.asp</p>
            <p>使用方法：</p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  在要实现生成静态功能的页面头部添加</p>
            <p>&nbsp;&nbsp;&nbsp;<font size="4"><strong>&nbsp;&nbsp;  <font style="background-color: #ff0000" color="#ffffff">&lt;!--#include file=&quot;&lt;你存放的路径&gt;/makehtml.inc.asp&quot;--&gt;</font></strong></font></p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  在需要调用生成静态页面的地方添加</p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style="background-color: #ff0000" color="#ffffff" size="4"><strong> MakeHtml &ldquo;</strong></font><font style="background-color: #ff0000" color="#ffffff" size="4"><strong>http://localhost</strong></font><font style="background-color: #ff0000" color="#ffffff" size="4"><strong>/index.asp&quot;,&quot;/index.html&quot;</strong></font></p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  上面的路径换成你自己的，这样即可无模板生成静态页面。不过这种方法比较耗资源，生成速度慢，但是简单易上手。</p>
            </div>
            </td>
        </tr>
    </tbody>
</table> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%CD%F8%C2%E7%B3%CC%D0%F2">网络程序</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/57e8f350d98630551138c242.html#comment">查看评论</a>]]></description>
        <pubDate>2009-09-07  07:34</pubDate>
        <category><![CDATA[网络程序]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/57e8f350d98630551138c242.html</guid>
</item>

<item>
        <title><![CDATA[asp防盗连技术]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/f63f55c2e9e2483ce5dd3b9d.html]]></link>
        <description><![CDATA[
		
		<p class="g_p_center g_t_wrap g_t_left g_t_20 g_c_pdin c07" style="margin: 20px auto 10px"><span>ASP防盗链综合实例</span></p>
<div class="g_p_center g_t_right g_c_pdin g_h_20 c08" style="margin-bottom: 15px">
<div class="g_p_left"><a class="c05" href="http://blog.163.com/loveby521/blog/static/10545040200963074935764/#"><font color="#fd83c9">默认分类</font></a> &nbsp;&nbsp;<span class="g_t_12 c08">2009-07-30 19:49</span> <span class="c08">&nbsp;&nbsp; 阅读<nobr >17</nobr>&nbsp;&nbsp;&nbsp; 评论<nobr >0</nobr></span> <span class="c08"> </span></div>
<div>字号： <a class="g_c_ul c05" style="font-size: 12px" href="http://blog.163.com/loveby521/blog/static/10545040200963074935764/#"><font color="#fd83c9">大</font></a><span class="g_t_bold c07" style="display: none"><strong><font color="#facbf6">大</font></strong></span>  <a class="g_c_ul c05" style="font-size: 12px" href="http://blog.163.com/loveby521/blog/static/10545040200963074935764/#"><font color="#fd83c9">中</font></a><span class="g_t_bold c07" style="display: none"><strong><font color="#facbf6">中</font></strong></span>  <a class="g_c_ul c05" style="display: none; font-size: 12px" href="http://blog.163.com/loveby521/blog/static/10545040200963074935764/#"><font color="#fd83c9">小</font></a><span class="g_t_bold c07" style="display: inline"><strong><font color="#facbf6">小</font></strong></span></div>
</div>
<div class="g_blog_list">
<div class="g_t_center g_c_pdin g_p_center c07 content" >
<div class="ns_content">
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">'盗链判断</p>
<p style="text-indent: 2em">Dim server_v1,server_v2</p>
<p style="text-indent: 2em">server_v1=Cstr(Request.ServerVariables(&quot;HTTP_REFERER&quot;))</p>
<p style="text-indent: 2em">server_v2=Cstr(Request.ServerVariables(&quot;SERVER_NAME&quot;))</p>
<p style="text-indent: 2em">If Mid(server_v1,8,len(server_v2))&lt;&gt;server_v2 Then</p>
<p style="text-indent: 2em">Response.Write &quot;非法的盗链&quot;</p>
<p style="text-indent: 2em">Response.End</p>
<p style="text-indent: 2em">End If</p>
<p style="text-indent: 2em">Dim url, body, myCache</p>
<p style="text-indent: 2em">url = Request.QueryString(&quot;url&quot;)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Set myCache = new cache</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  myCache.name = &quot;picindex&quot;&amp;url</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  If myCache.valid Then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  body = myCache.value</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  body = GetWebData(url)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  myCache.add body,dateadd(&quot;d&quot;,1,now)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  End If</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  If Err.Number = 0 Then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Response.CharSet = &quot;UTF-8&quot;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Response.ContentType = &quot;application/octet-stream&quot;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Response.BinaryWrite body</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Response.Flush</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Wscript.Echo Err.Description</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  End if</p>
<p style="text-indent: 2em">'取得数据</p>
<p style="text-indent: 2em">Public Function GetWebData(ByVal strUrl)</p>
<p style="text-indent: 2em">Dim curlpath</p>
<p style="text-indent: 2em">curlpath = Mid(strUrl,1,Instr(8,strUrl,&quot;/&quot;))</p>
<p style="text-indent: 2em">Dim Retrieval</p>
<p style="text-indent: 2em">Set Retrieval = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)</p>
<p style="text-indent: 2em">With Retrieval</p>
<p style="text-indent: 2em">.Open &quot;Get&quot;, strUrl, False,&quot;&quot;,&quot;&quot;</p>
<p style="text-indent: 2em">.setRequestHeader &quot;Referer&quot;, curlpath</p>
<p style="text-indent: 2em">.Send</p>
<p style="text-indent: 2em">GetWebData =.ResponseBody</p>
<p style="text-indent: 2em">End With</p>
<p style="text-indent: 2em">Set Retrieval = Nothing</p>
<p style="text-indent: 2em">End Function</p>
<p style="text-indent: 2em">'cache类</p>
<p style="text-indent: 2em">class Cache</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private obj&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;&nbsp;&nbsp;&nbsp;  'cache内容</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private expireTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '过期时间</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private expireTimeName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '过期时间application名</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private cacheName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  'cache内容application名</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  'url</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private sub class_initialize()</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  path=request.servervariables(&quot;url&quot;)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  path=left(path,instrRev(path,&quot;/&quot;))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end sub</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private sub class_terminate()</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end sub</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public property get blEmpty</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '是否为空</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if isempty(obj) then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  blEmpty=true</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  blEmpty=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end property</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public property get valid</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '是否可用(过期)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if isempty(obj) or not isDate(expireTime) then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  valid=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  elseif CDate(expireTime)&lt;now then</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  valid=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  valid=true</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end property</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public property let name(str)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '设置cache名</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  cacheName=str &amp; path</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  obj=application(cacheName)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  expireTimeName=str &amp; &quot;expires&quot; &amp; path</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  expireTime=application(expireTimeName)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end property</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public property let expires(tm)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '重设置过期时间</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  expireTime=tm</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application.lock</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application(expireTimeName)=expireTime</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application.unlock</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end property</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public sub add(var,expire)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '赋值</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if isempty(var) or not isDate(expire) then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  exit sub</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  obj=var</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  expireTime=expire</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application.lock</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application(cacheName)=obj</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application(expireTimeName)=expireTime</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application.unlock</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end sub</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public property get value</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '取值</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if isempty(obj) or not isDate(expireTime) then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  value=null</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  elseif CDate(expireTime)&lt;now then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  value=null</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  value=obj</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end property</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public sub makeEmpty()</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '释放application</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application.lock</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application(cacheName)=empty</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application(expireTimeName)=empty</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  application.unlock</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  obj=empty</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  expireTime=empty</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end sub</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public function equal(var2)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  '比较</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if typename(obj)&lt;&gt;typename(var2) then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  equal=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  elseif typename(obj)=&quot;Object&quot; then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if obj is var2 then</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  equal=true</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  equal=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  elseif typename(obj)=&quot;Variant()&quot; then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if join(obj,&quot;^&quot;)=join(var2,&quot;^&quot;) then</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  equal=true</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  equal=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if obj=var2 then</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  equal=true</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else</p>
<p style="text-indent: 2em">&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;&nbsp;&nbsp;&nbsp;  equal=false</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end if</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  end function</p>
<p style="text-indent: 2em">end class</p>
<p style="text-indent: 2em">%&gt;</p>
<p style="text-indent: 2em">第一种:</p>
<p style="text-indent: 2em">终于对下载系统做了个防盗链措施，在下载的页面头部做了如下代码，相关代码如下：</p>
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">From_url = Cstr(Request.ServerVariables(&quot;HTTP_REFERER&quot;))</p>
<p style="text-indent: 2em">Serv_url = Cstr(Request.ServerVariables(&quot;SERVER_NAME&quot;))</p>
<p style="text-indent: 2em">if mid(From_url,8,len(Serv_url)) &lt;&gt; Serv_url and mid(From_url,8,len(Serv_url))&lt;&gt;&quot;ITstudy.cn&quot; and mid(From_url,8,len(Serv_url))&lt;&gt;&quot;www.ITstudy.cn&quot; then</p>
<p style="text-indent: 2em">response.write &quot;您下载的软件来自IT学习网，请直接从主页下载，谢谢&lt;br&gt;&quot; &rsquo;防止盗链</p>
<p style="text-indent: 2em">response.write &quot;&lt;a href=http://www.ITstudy.cn&gt;IT学习网http://www.ITstudy.cn&lt;/a&gt;&quot; &rsquo;防止盗链</p>
<p style="text-indent: 2em">response.end</p>
<p style="text-indent: 2em">end if</p>
<p style="text-indent: 2em">%&gt;</p>
<p style="text-indent: 2em">第二种:</p>
<p style="text-indent: 2em">&lt;%&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  &rsquo;定义函数，用ADODB.Stream读取二进制数据&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Function ReadBinaryFile(FileName)&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  Const adTypeBinary = 1&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  Dim BinaryStream&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  Set BinaryStream = CreateObject(&quot;ADODB.Stream&quot;)&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  BinaryStream.Type = adTypeBinary&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  BinaryStream.Open&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  BinaryStream.LoadFromFile FileName&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;  ReadBinaryFile = BinaryStream.Read&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  End Function&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Response.AddHeader &quot;Content-Disposition&quot;, &quot;attachment;filename=2.gif&quot;&rsquo;文件名&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Response.ContentType = &quot;image/GIF&quot; &rsquo;设置（1）&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  response.Binarywrite ReadBinaryFile(server.mappath(&quot;2.gif&quot;))&rsquo;就是你读取存在本地的文件，防止被</p>
<p style="text-indent: 2em">别人知道真实路径盗连的。&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  %&gt;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">（1）下面的示例将 ContentType 属性设置为其他的常见值。&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  text/HTML 这个就不说了&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  image/GIF gif图片&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  image/JPEG jpg图片&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  application/x-cdf cdf文档&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  application/wma 就是西瓜哪个音乐类型了&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  具体可以参照 Web 浏览器文档或当前的 HTTP 规格说明&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  这样再利用asp的储存session，cookies，以及读取HTTP头等特殊功能就可以完全真正的实现防盗连，这里</p>
<p style="text-indent: 2em">没有设置缓存，如果访问量巨大，我想设置下就会更好吧。&nbsp;&nbsp;</p>
<p style="text-indent: 2em">第三种:</p>
<p style="text-indent: 2em">最简单的用Active Server Pages防站外提交表单、跨站提交表单、防盗链……</p>
<p style="text-indent: 2em">方法：Request.SeverVariables(&quot;HTTP_REFERER&quot;)</p>
<p style="text-indent: 2em">解释：当某人通过链接到达当前页，HTTP_REFERER 就保存了这个用户的来源（来路）</p>
<p style="text-indent: 2em">举个例子，这个例子很简单，只是抛砖引玉而已，大家可以增加更多的功能。</p>
<p style="text-indent: 2em">如下，只有首先从&ldquo; http://www.ITstudy.cn&rdquo;登陆才能看到文件内容。</p>
<p style="text-indent: 2em">源码：index.asp</p>
<p style="text-indent: 2em">&lt;html&gt;</p>
<p style="text-indent: 2em">&lt;head&gt;&lt;title&gt;最简单的用asp防盗链&lt;/title&gt;&lt;/head&gt;</p>
<p style="text-indent: 2em">&lt;body&gt;</p>
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">Option.Explicit</p>
<p style="text-indent: 2em">Response.Buffer=Ture</p>
<p style="text-indent: 2em">%&gt;</p>
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">CheckUrl(&quot;http://ITstudy.cn/index.jsp&quot;)</p>
<p style="text-indent: 2em">%&gt;</p>
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">Function CheckUrl(url)</p>
<p style="text-indent: 2em">Dim Where:Where=Request.SeverVariables(&quot;HTTP_REFERER&quot;)</p>
<p style="text-indent: 2em">If Where=url Then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Call main()</p>
<p style="text-indent: 2em">Else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  Response.write(&quot;很抱歉，您必须从&quot;&amp;url&amp;&quot;访问才能进来！&quot;)</p>
<p style="text-indent: 2em">End if</p>
<p style="text-indent: 2em">End Function</p>
<p style="text-indent: 2em">%&gt;</p>
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">Sub main()</p>
<p style="text-indent: 2em">Response.write(&quot;这儿是你要显示的网页内容&quot;)</p>
<p style="text-indent: 2em">End sub</p>
<p style="text-indent: 2em">%&gt;</p>
<p style="text-indent: 2em">&lt;/body&gt;</p>
<p style="text-indent: 2em">&lt;/html&gt;</p>
<p style="text-indent: 2em">该方法对防止盗链文章、站外提交表单、跨站提交表单还比较有效，对于软件盗链比如.rar.zip.exe等倒没什么作用。</p>
<p style="text-indent: 2em">不知各位读者是否有好的主意，呵呵。&nbsp;&nbsp;</p>
<p style="text-indent: 2em"> </p>
<p style="text-indent: 2em">还有一种方法就是用判断服务器及上一页的地址来完成。</p>
<p style="text-indent: 2em">&lt;%</p>
<p style="text-indent: 2em">dim from, local</p>
<p style="text-indent: 2em">from = request.ServerVariables(&quot;HTTP_REFERER&quot;)</p>
<p style="text-indent: 2em">local = request.ServerVariables(&quot;SERVER_NAME&quot;)</p>
<p style="text-indent: 2em">If mid(from, 8, local)&lt;&gt;Len(local) Then</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  response.write &quot;不要从外部提交数据&quot;</p>
<p style="text-indent: 2em">else</p>
<p style="text-indent: 2em">&nbsp;&nbsp;  call main()</p>
<p style="text-indent: 2em">end if</p>
<p style="text-indent: 2em">sub main()</p>
<p style="text-indent: 2em">&rsquo;你的主体内容</p>
<p style="text-indent: 2em">end sub</p>
<p style="text-indent: 2em">%&gt;</p>
</div>
</div>
</div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%CD%F8%C2%E7%B3%CC%D0%F2">网络程序</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/f63f55c2e9e2483ce5dd3b9d.html#comment">查看评论</a>]]></description>
        <pubDate>2009-08-23  13:16</pubDate>
        <category><![CDATA[网络程序]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/f63f55c2e9e2483ce5dd3b9d.html</guid>
</item>

<item>
        <title><![CDATA[各种网站建设500起，有诚意请联系13410422984]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/2b4c13f7add51b2b730eec64.html]]></link>
        <description><![CDATA[
		
		<p>本人是从事网站开发多年，一般的网站一两天之内都可以搞定，全新代码调用函数，使用起来方便，网站后台功能完全，几乎所有的功能都可以实现。可根据用户要求选择ASP/PHP/。NET，联系网站，<a href="http://web1016.cn/">http://kongjian114.cn</a>,同时本人还运营有一商城<a href="http://szpjshop.com/">http://szpjshop.com</a>上面有最新的便宜手机，MP3，以及服装产品欢迎大家前来选购。联系电话：13410422984，qq:277825884,258410999</p>
<p>听音乐上无忧音乐网<a href="http://51-music.com.cn/">http://51-music.com.cn</a> 卖LV包包上<a href="http://coco-lv.cn/">http://coco-lv.cn</a></p>
<p>有上千种LV包包供你选择</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/2b4c13f7add51b2b730eec64.html#comment">查看评论</a>]]></description>
        <pubDate>2009-07-29  19:52</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/2b4c13f7add51b2b730eec64.html</guid>
</item>

<item>
        <title><![CDATA[CSS常用布局实例]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/2782347394bcc6148701b084.html]]></link>
        <description><![CDATA[
		
		网上流传的，我觉得很经典了，你可以看原地址更清楚些。 <br>
<br>
<br>
CSS常用布局实例 <br>
<br>
一列 <br>
单行一列 <br>
<br>
body { margin: 0px; padding: 0px; text-align: center; } <br>
#content { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } <br>
<br>
两行一列 <br>
<br>
body { margin: 0px; padding: 0px; text-align: center;} <br>
#content-top { margin-left:auto; margin-right:auto; width: 400px; width: 370px;} <br>
#content-end {margin-left:auto; margin-right:auto; width: 400px; width: 370px;} <br>
<br>
三行一列 <br>
<br>
body { margin: 0px; padding: 0px; text-align: center; } <br>
#content-top { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } <br>
#content-mid { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } <br>
#content-end { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } <br>
<br>
两列 <br>
单行两列 <br>
<br>
#bodycenter { width: 700px;margin-right: auto; margin-left: auto;overflow: auto; } <br>
#bodycenter #dv1 {float: left;width: 280px;} <br>
#bodycenter #dv2 {float: right;width: 410px;} <br>
<br>
两行两列 <br>
<br>
#header{ width: 700px; margin-right: auto;margin-left: auto; overflow: auto;} <br>
#bodycenter { width: 700px; margin-right: auto; margin-left: auto; overflow: auto; } <br>
#bodycenter #dv1 { float: left; width: 280px;} <br>
#bodycenter #dv2 { float: right;width: 410px;} <br>
<br>
三行两列 <br>
<br>
#header{ width: 700px;margin-right: auto; margin-left: auto; } <br>
#bodycenter {width: 700px; margin-right: auto; margin-left: auto; } <br>
#bodycenter #dv1 { float: left;width: 280px;} <br>
#bodycenter #dv2 { float: right; width: 410px;} <br>
#footer{ width: 700px; margin-right: auto; margin-left: auto; overflow: auto; } <br>
<br>
三列 <br>
单行三列 <br>
绝对定位 <br>
<br>
#left { position: absolute; top: 0px; left: 0px; width: 120px; } <br>
#middle {margin: 20px 190px 20px 190px; } <br>
#right {position: absolute;top: 0px; right: 0px; width: 120px;} <br>
<br>
float定位 <br>
<br>
xhtml: <br>
<br>
&lt;div id=&quot;warp&quot;&gt; <br>
&lt;div id=&quot;column&quot;&gt; <br>
&lt;div id=&quot;column1&quot;&gt;这里是第一列&lt;/div&gt; <br>
&lt;div id=&quot;column2&quot;&gt;这里是第二列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
&lt;div id=&quot;column3&quot;&gt;这里是第三列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
<br>
CSS: <br>
<br>
#wrap{ width:100%; height:auto;} <br>
#column{ float:left; width:60%;} <br>
#column1{ float:left; width:30%;} <br>
#column2{ float:right; width:30%;} <br>
#column3{ float:right; width:40%;} <br>
.clear{ clear:both;} <br>
<br>
float定位二 <br>
<br>
xhtml: <br>
<br>
&lt;div id=&quot;center&quot; class=&quot;column&quot;&gt; <br>
&lt;h1&gt;This is the main content.&lt;/h1&gt; <br>
&lt;/div&gt; <br>
&lt;div id=&quot;left&quot; class=&quot;column&quot;&gt; <br>
&lt;h2&gt;This is the left sidebar.&lt;/h2&gt; <br>
&lt;/div&gt; <br>
&lt;div id=&quot;right&quot; class=&quot;column&quot;&gt; <br>
&lt;h2&gt;This is the right sidebar.&lt;/h2&gt; <br>
&lt;/div&gt; <br>
<br>
CSS: <br>
<br>
body {margin: 0;padding-left: 200px;padding-right: 190px;min-width: 240px;} <br>
.column {position: relative;float: left;} <br>
#center {width: 100%;} <br>
#left {width: 180px; right: 240px;margin-left: -100%;} <br>
#right {width: 130px;margin-right: -100%;} <br>
<br>
两行三列 <br>
<br>
xhtml: <br>
<br>
&lt;div id=&quot;header&quot;&gt;这里是顶行&lt;/div&gt; <br>
&lt;div id=&quot;warp&quot;&gt; <br>
&lt;div id=&quot;column&quot;&gt; <br>
&lt;div id=&quot;column1&quot;&gt;这里是第一列&lt;/div&gt; <br>
&lt;div id=&quot;column2&quot;&gt;这里是第二列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
&lt;div id=&quot;column3&quot;&gt;这里是第三列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
<br>
CSS: <br>
<br>
#header{width:100%; height:auto;} <br>
#wrap{ width:100%; height:auto;} <br>
#column{ float:left; width:60%;} <br>
#column1{ float:left; width:30%;} <br>
#column2{ float:right; width:30%;} <br>
#column3{ float:right; width:40%;} <br>
.clear{ clear:both;} <br>
<br>
三行三列 <br>
<br>
xhtml: <br>
<br>
&lt;div id=&quot;header&quot;&gt;这里是顶行&lt;/div&gt; <br>
&lt;div id=&quot;warp&quot;&gt; <br>
&lt;div id=&quot;column&quot;&gt; <br>
&lt;div id=&quot;column1&quot;&gt;这里是第一列&lt;/div&gt; <br>
&lt;div id=&quot;column2&quot;&gt;这里是第二列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
&lt;div id=&quot;column3&quot;&gt;这里是第三列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
&lt;div id=&quot;footer&quot;&gt;这里是底部一行&lt;/div&gt; <br>
<br>
CSS: <br>
<br>
#header{width:100%; height:auto;} <br>
#wrap{ width:100%; height:auto;} <br>
#column{ float:left; width:60%;} <br>
#column1{ float:left; width:30%;} <br>
#column2{ float:right; width:30%;} <br>
#column3{ float:right; width:40%;} <br>
.clear{ clear:both;} <br>
#footer{width:100%; height:auto;} <br>
<br>
PS:这里列出的是常用的例子，而非研究之用，对一每个盒子，我都没有设置margin,padding,boeder等属性，是因为我个人觉得，含有宽度定位的时候，最好不好用到他们，除非必不得已，因为如果不是这样的话，解决浏览器兼容问题，会让你头疼，而且产生一系列CSS代码，我觉得这样的效率和效果都不好！ <br>
<br>
3.CSS布局高级技巧 <br>
<br>
margin和padding总是有可能要用到，而产生的问题如何解决呢？由于浏览器解释容器宽度的方法不同： <br>
<br>
IE 6.0 Firefox Opera等是 <br>
真实宽度=width+padding+border+margin <br>
IE5.X <br>
真实宽度=width-padding-border-margin <br>
<br>
很明显，第一种下很完美的布局在第二种情况下后果是很凄惨的！ <br>
<br>
解决的方法是 hack <br>
<br>
<br>
div.content { <br>
width:400px; //这个是错误的width，所有浏览器都读到了 <br>
voice-family: &quot;\&quot;}\&quot;&quot;; //IE5.X/win忽略了&quot;\&quot;}\&quot;&quot;后的内容 <br>
voice-family:inherit; <br>
width:300px; //包括IE6/win在内的部分浏览器读到这句，新的数值(300px)覆盖掉了旧的 <br>
} <br>
html&gt;body .content { //html&gt;body是CSS2的写法 <br>
width:300px; //支持CSS2该写法的浏览器(非IE5)有幸读到了这一句 <br>
} <br>
<br>
div.content { <br>
width:300px !important; //这个是正确的width，大部分支持!important标记的浏览器使用这里的数值 <br>
width(空格)/**/:400px; //IE6/win不解析这句，所以IE6/win仍然认为width的值是300px；而IE5.X/win读到这句，新的数值(400px)覆盖掉了旧的，因为!important标记对他们不起作用 <br>
} <br>
html&gt;body .content { //html&gt;body是CSS2的写法 <br>
width:300px; //支持CSS2该写法的浏览器有幸读到了这一句 <br>
} <br>
<br>
具体解释点击下面链接查看 <br>
<br>
<a href="http://www.blueidea.com/tech/site/2006/3170.asp" target="_blank">www.blueidea.com/tech/site/2006/3170.asp</a> <br>
<a href="http://www.jluvip.com/blog/article.asp?id=114" target="_blank">www.jluvip.com/blog/article.asp?id=114</a> <br>
<br>
列等高技巧 <br>
<br>
n行n列布局，每列高度（事先并不能确定哪列的高度）的相同，是每个设计师追求的目标，做法有：背景图填充、加JS脚本的 <br>
方法和容器溢出部分隐藏和列的负底边界和正的内补丁相结合的方法。 <br>
<br>
背景图填充法： <br>
<br>
xhtml: <br>
<br>
&lt;div id=&quot;wrap&quot;&gt; <br>
&lt;div id=&quot;column1&quot;&gt;这是第一列&lt;/div&gt; <br>
&lt;div id=&quot;column1&quot;&gt;这是第二列&lt;/div&gt; <br>
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt; <br>
&lt;/div&gt; <br>
<br>
css: <br>
<br>
#wrap{ width:776px; background:url(bg.gif) repeat-y 300px;} <br>
#column1{ float:left; width:300px;} <br>
#column2{ float:right; width:476px;} <br>
.clear{ clear:both;} <br>
<br>
就是将一个npx宽的一张图片在外部容器纵向重复，定位到两列交错的位置纵向重复，在视觉上产生了两列高度一样的错觉 <br>
<br>
JS脚本法： <br>
<br>
<a href="http://www.blueidea.com/bbs/NewsDetail.asp?id=2453983" target="_blank">www.blueidea.com/bbs/NewsDetail.asp?id=2453983</a> <br>
代码的原理基本就是这样，读取高度，判断高度，高度相等。 <br>
<br>
容器溢出部分隐藏和列的负底边界和正的内补丁相结合的方法 <br>
<br>
这篇文章说的很详细了： <br>
<br>
<a href="http://www.blueidea.com/tech/web/2006/3210.asp" target="_blank">www.blueidea.com/tech/web/2006/3210.asp</a> <br>
<br>
还有： <br>
<br>
<a href="http://www.jluvip.com/blog/article.asp?id=151" target="_blank">www.jluvip.com/blog/article.asp?id=151</a> <br>
<br>
满屏高度布局（最窄770px最宽1024px经典布局） <br>
<br>
<a href="http://www.blueidea.com/tech/web/2005/3124.asp" target="_blank">www.blueidea.com/tech/web/2005/3124.asp</a> <br>
<br>
今天和一个网友两天，他提到：给一个外国公司做网站，要求1.800x600满屏。2.1024x767满屏。3.1280下居中。4.不许用JS。 <br>
我突然想起了这篇文章，哈哈！把它感觉不可思议的事情解决了！但是好像对于IE5有点问题啊！<br>
参考资料：<a href="http://bbs.blueidea.com/viewthread.php?tid=2506047" target="_blank">http://bbs.blueidea.com/viewthread.php?tid=2506047</a> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/2782347394bcc6148701b084.html#comment">查看评论</a>]]></description>
        <pubDate>2009-04-18  12:05</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/2782347394bcc6148701b084.html</guid>
</item>

<item>
        <title><![CDATA[PHP生成excle]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/145e1055ab3e8dccb745aefb.html]]></link>
        <description><![CDATA[
		
		<strong><font color="#295200" size="5">用php生成excel文件</font></strong>
<table style="border-collapse: collapse" bordercolor="#a5bd6b" cellspacing="1" cellpadding="0" width="100%" border="1">
    <tbody>
        <tr>
            <td align="center">
            <table style="border-collapse: collapse; word-wrap: break-word" cellspacing="0" cellpadding="0" width="100%" border="0">
                <tbody>
                    <tr>
                        <td align="center">
                        <table style="border-collapse: collapse; word-wrap: break-word" cellspacing="0" cellpadding="0" width="100%" border="0">
                            <tbody>
                                <tr>
                                    <td>
                                    <div style="margin: 15px">
                                    <div>
                                    <div class="msgheader">
                                    <div class="right">PHP代码:</div>
                                    </div>
                                    <div class="msgborder" >
                                    <div class="php">
                                    <ol>
                                        <li class="li1">
                                        <div class="de1"><span class="kw2"><strong><font color="#000080">&lt;?</font></strong></span></div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/header"><span class="kw3"><font color="#0000cd">header</font></span></a><span class="br0"><font color="#66cc66">(</font></span><span class="st0">&quot;Content-type:application/vnd.ms-excel&quot;</span><span class="br0"><font color="#66cc66">)</font></span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li2">
                                        <div class="de2">  &nbsp;&nbsp;    <a href="http://www.php.net/header"><span class="kw3"><font color="#0000cd">header</font></span></a><span class="br0"><font color="#66cc66">(</font></span><span class="st0">&quot;Content-Disposition:filename=test.xls&quot;</span><span class="br0"><font color="#66cc66">)</font></span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test1t&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test2tn&quot;</span>;</div>
                                        </li>
                                        <li class="li2">
                                        <div class="de2"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test1t&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test2tn&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li2">
                                        <div class="de2">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test1t&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test2tn&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test1t&quot;</span>;</div>
                                        </li>
                                        <li class="li2">
                                        <div class="de2"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test2tn&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test1t&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li2">
                                        <div class="de2">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test2tn&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test1t&quot;</span>;</div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1">  &nbsp;&nbsp;    <a href="http://www.php.net/echo"><span class="kw3"><font color="#0000cd">echo</font></span></a> <span class="st0">&quot;test2tn&quot;</span>;</div>
                                        </li>
                                        <li class="li2">
                                        <div class="de2"> </div>
                                        </li>
                                        <li class="li1">
                                        <div class="de1"><span class="kw2"><strong><font color="#000080">?&gt;</font></strong></span></div>
                                        </li>
                                    </ol>
                                    </div>
                                    </div>
                                    <br>
                                    在php环境运行上面的代码，大家就可以看到浏览器询问用户是否下载excel<br>
                                    <br>
                                    文档，点击保存，硬盘上就多了一个excel的文件，使用excel打开就会看到<br>
                                    <br>
                                    最终的结果，怎么样不错吧。<br>
                                    <br>
                                    其实在做真正的应用的时候，大家可以将数据从数据库中取出，然后按照每<br>
                                    <br>
                                    一列数据结束后加\t,每一行数据结束后加\n的方法echo出来，在php的开头<br>
                                    <br>
                                    用header(&quot;Content-type:application/vnd.ms-excel&quot;);表示输出的是<br>
                                    <br>
                                    excel文件，用header(&quot;Content-Disposition:filename=test.xls&quot;);表<br>
                                    <br>
                                    示输出的文件名为text.xls。这样就ok了。<br>
                                    <br>
                                    我们更可以修改header让他输出更多格式的文件，这样php在处理各种类型<br>
                                    <br>
                                    文件方面就更加方便了。</div>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%CD%F8%C2%E7%B3%CC%D0%F2">网络程序</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/145e1055ab3e8dccb745aefb.html#comment">查看评论</a>]]></description>
        <pubDate>2009-04-11  21:32</pubDate>
        <category><![CDATA[网络程序]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/145e1055ab3e8dccb745aefb.html</guid>
</item>

<item>
        <title><![CDATA[cookie欺骗教程]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/3894a8fb2383372a4e4aea69.html]]></link>
        <description><![CDATA[
		
		<table class="modth" cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="modtc" nowrap="nowrap">
            <div class="modhead"><span class="modtit">查看文章</span></div>
            </td>
            <td class="modtc" nowrap="nowrap" align="right"> </td>
            <td class="modtr" width="7"> </td>
        </tr>
    </tbody>
</table>
<div class="modbox" >
<div class="tit">cookie欺骗教程（1）</div>
<div class="date">2009-01-18 16:54</div>
<table style="table-layout: fixed">
    <tbody>
        <tr>
            <td>
            <div class="cnt" ><font face="宋体">cookie欺骗教程（1）<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  ---------产生一个COOKIE文件并改变它<br>
            <br>
            &nbsp;&nbsp;&nbsp;  唉，很早就想点关于COOKIE的东东了，主要是网上有不少文章说半天其实也<br>
            没有多少实质的东西。<br>
            &nbsp;&nbsp;&nbsp;  首先大家明白什么是COOKIE，具体点说如果是98那么它们默认存放在C:\</font><a class="wordstyle" href="http://www.newasp.cn/" target="_blank"><font face="宋体">windows</font></a><font face="宋体">\cookies<br>
            目录下，如果是2k它们在C:\Documents and Settings\%你的用户名%\Cookies目录下（每个文件都不会超过4KB）<br>
            &nbsp;&nbsp;&nbsp;  它们的文件名格式为：你的用户名@产生的COOKIE的网页文件所在的WEB目录[COOKIE改变的次数].txt<br>
            &nbsp;&nbsp;&nbsp;  具体的例子：iwam_system@cookie[3].txt<br>
            &nbsp;&nbsp;&nbsp;  再来看一看一个最简单的COOKIE文件的内容：<br>
            &nbsp;&nbsp;&nbsp;  level<br>
            admin<br>
            www.locking.8u8.com/cookie/<br>
            0<br>
            1331699712<br>
            29536653<br>
            4044081984<br>
            29528196<br>
            *<br>
            &nbsp;&nbsp;&nbsp;<br>
            &nbsp;&nbsp;&nbsp;  最前面的两段为服务器产生的COOKIE内容（level和admin）第三段为产生这个COOKIE文件的网站的域名和WEB目录<br>
            这儿就要注意了没有记录产生COOKIE文件的文件名！所以在同一个目录下不同文件产生的COOKIE是同一个文件只是每<br>
            产生一次COOKIE的文件名的中括号里的数字就要加1，后面的那些就不管它了我也不懂哈:)<br>
            &nbsp;&nbsp;&nbsp;  再来看看如何生成一个COOKIE我以vbs cript为例：<br>
            <br>
            &lt;s cript language=vbs&gt;<br>
            document.cookie=&quot;level&quot; &amp; &quot;=&quot; &amp; &quot;user&quot; &amp; &quot;;expires=Monday, 01-Jan-03 12:00:00 GMT&quot;<br>
            msgbox document.cookie<br>
            &lt;/s cript&gt;<br>
            <br>
            &nbsp;&nbsp;  这儿我们特别人注意的是最后一段 &quot;;expires=Monday, 01-Jan-03 12:00:00 GMT&quot;这是用来说明产生的COOKIE文件的<br>
            有效时间的，如果没有那么这个COOKIE你将不会在本文开头所说的目录里找到它。这个例子中有效时间是2003年当然你<br>
            <br>
            也就能在本地硬盘上找到它们了。<br>
            &nbsp;&nbsp;  另外当用document.cookie来得到COOKIE内容时设置COOKIE有效时间这一段将被忽略（当然这也方便了网站的COOKIE<br>
            <br>
            *作）比如说上面将弹出一个内容为&nbsp;&nbsp;  level=user的对话框<br>
            <br>
            好了现在我们来实战一下：<br>
            我的网站叫www.locking.8u8.com在它的COOKIE目录里有两个文件一个是admin1.htm内容就是上面的例子<br>
            还有一个文件叫level1.htm内容如下：<br>
            &lt;s cript language=vbs&gt;<br>
            co=document.cookie<br>
            le=mid(co,instr(co,&quot;=&quot;)+1,len(co)-instr(co,&quot;=&quot;)+1)<br>
            if le=&quot;user&quot; then<br>
            msgbox &quot;you are a user&quot;<br>
            else<br>
            if le=&quot;admin&quot; then<br>
            msgbox &quot;you are a administrator&quot;<br>
            else<br>
            msgbox &quot;you not login&quot;<br>
            end if<br>
            end if<br>
            &lt;/s cript&gt;<br>
            <br>
            当你先浏览admin1.htm后再浏览level1.htm时将弹出一个对话框内容为：&quot;you are a user&quot;，当你没有浏览过<br>
            admin1.htm而直接浏览level1.htm将说 &quot;you not login&quot; (注意有的人可能会先浏览admin1.htm后再直接在硬盘<br>
            上更改COOKIE的内容当然这样是不行的)<br>
            <br>
            &nbsp;&nbsp;  好了我们的目标就是让我们能在浏览level1时弹个框框说 &quot;you are a administrator&quot; :)<br>
            &nbsp;&nbsp;  办法只有两个咯：1）把8u8黑了，然后找到那个level1.htm改了不就可以了不过本篇文章不做讨论哈<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  2）进行COOKIE欺骗，OK LET GO：）<br>
            <br>
            -----------------------------------（我的系统环境一台2kserver+iis5）<br>
            第一步：自已做一个文件名叫admin2.htm吧内容如下<br>
            &lt;s cript language=vbs&gt;<br>
            document.cookie=&quot;level&quot; &amp; &quot;=&quot; &amp; &quot;admin&quot; &amp; &quot;;expires=Monday, 01-Jan-03 12:00:00 GMT&quot;<br>
            &lt;/s cript&gt;<br>
            然后把它放入一个名叫COOKIE的可浏览目录中（COOKIE要位于根目录）<br>
            <br>
            第二步：找到位于C:\WINNT\system32\drivers\etc下的hosts文件在它的后面加上如下一段：<br>
            <br>
            127.0.0.1 www.locking.8u8.com<br>
            <br>
            第三步：仿问www.locking.8u8.com/cookie/admin2.htm(这儿实际是仿问的本机的文件)<br>
            <br>
            第四步：删除hosts中刚才我们添加的内容然后再清掉IE的历史记录<br>
            <br>
            第五步：让我们再次仿问www.locking.8u8.com/cookie/level1.htm<br>
            <br>
            &nbsp;&nbsp;  怎么样我们现在是 administrator了吧（注意仿问网站是一定要在前面加三个w）<br>
            <br>
            <br>
            COOKIE欺骗教程2<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  -------------&nbsp;&nbsp;&nbsp;  利用winsocket编程发送伪造COOKIE<br>
            <br>
            &nbsp;&nbsp;&nbsp;&nbsp;  在上一节中我所举的例子是一个存活期很长的COOKIE，对于这种<br>
            COOKIE他会生成在我们的本地盘上的，而对于那些关闭浏览器就失效<br>
            的COOKIE我们该怎样来进行欺骗伪造呢？<br>
            &nbsp;&nbsp;&nbsp;&nbsp;  首先我们应该知道在我第一节的例子中弹那个&quot;you are a administrator&quot;<br>
            框框的网页(level1.htm)其实是下载在我的本地然后执行的,也就是说<br>
            他对COOKIE的检验读取也是在本地，那如果是在远程服务器上呢？比如<br>
            一个ASP程序他又是如何读取我们的COOKIE的呢?<br>
            &nbsp;&nbsp;&nbsp;&nbsp;  先来看看基本的东东吧：当我们使用HTTP协议向远程主机发送一个<br>
            GET或是POST请求时，那么如果有这个域名的COOKIE存在(不管是在内存中<br>
            还是本地盘上的)都将和请求一起发送到服务器去.<br>
            <br>
            下面的就是一个实际的例子:<br>
            <br>
            GET /ring/admin.asp HTTP/1.1<br>
            Accept: */*<br>
            Accept-Language: zh-cn<br>
            Accept-Encoding: gzip, deflate<br>
            User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; </font><a class="wordstyle" href="http://www.newasp.cn/" target="_blank"><font face="宋体">Windows</font></a><font face="宋体"> 98)<br>
            Host: 61.139.xx.xx<br>
            Connection: Keep-Alive<br>
            Cookie: level=user; ASPSESSIONIDSSTCRACS=ODMLKJMCOCJMNJIEDFLELACM<br>
            <br>
            看到最后一行了吧:)<br>
            <br>
            &nbsp;&nbsp;&nbsp;&nbsp;  然后我们再来看看服务器是如何进行COOKIE检验的，我举了一个简单的例子:<br>
            有两个ASP文件一个叫admin.asp，还有一个叫level.asp<br>
            <br>
            -----------admin.asp------------------<br>
            &lt;%response.write now()%&gt;<br>
            &lt;%response.write &quot;&lt;br&gt;&quot;%&gt;<br>
            &lt;%response.cookies(&quot;level&quot;)=&quot;user&quot;%&gt;<br>
            &lt;%response.write &quot;&lt;html&gt;&lt;s cript&gt;document.write(document.cookie);&lt;/s cript&gt;&lt;/html&gt;&quot;%&gt;<br>
            <br>
            -----------cut here-------------------<br>
            <br>
            -----------level.asp------------------<br>
            &lt;%<br>
            if&nbsp;&nbsp;  Request.Cookies(&quot;level&quot;)&lt;&gt;&quot;&quot; then<br>
            response.write &quot;&lt;html&gt;&lt;s cript&gt;document.write(document.cookie);&lt;/s cript&gt;&lt;/html&gt;&quot;<br>
            if request.cookies(&quot;level&quot;)=&quot;user&quot; then<br>
            response.write &quot;&lt;html&gt;&lt;s cript&gt;alert(&lt;|&gt;you are a user&lt;|&gt;);&lt;/s cript&gt;&lt;/html&gt;&quot;<br>
            else<br>
            &nbsp;&nbsp;&nbsp;&nbsp;  if request.cookies(&quot;level&quot;)=&quot;admin&quot; then<br>
            response.write &quot;&lt;html&gt;&lt;s cript&gt;alert(&lt;|&gt;you are administrator!&lt;|&gt;);&lt;/s cript&gt;&lt;/html&gt;&quot;<br>
            set fso1=server.createobject(&quot;s cripting.filesystemobject&quot;)<br>
            set fil=fso1.opentextfile(&quot;d:\sms\ring\a.txt&quot;,8,true)<br>
            fil.writeline &quot;you are admin!&quot;<br>
            &nbsp;&nbsp;&nbsp;&nbsp;  end if<br>
            end if<br>
            else<br>
            response.write &quot;&lt;html&gt;&lt;s cript&gt;alert(&lt;|&gt;you are not login&lt;|&gt;);&lt;/s cript&gt;&lt;/html&gt;&quot;<br>
            end if<br>
            %&gt; <br>
            -----------cut here-------------------<br>
            <br>
            &nbsp;&nbsp;  说明:当你请求admin.asp时，将产生一个临时的COOKIE(你关闭浏览器就会失效),然后我们不关闭浏览器而<br>
            请求level.asp时它就会用request.cookies来提取你发出的请求里面的cookie,如果你的COOKIE里面的内容是<br>
            admin的话那么它将用fso对象在服务器产生一个记录文件(a.txt要注意的是我们在实验时要把目录设为可写)<br>
            <br>
            &nbsp;&nbsp;  好了就介绍这么多吧，我们的目的就是让服务器产生a.txt并写入内容&quot;you are admin&quot;还是进行上一节的<br>
            域名欺骗吗?不是让我们写一个winsocket程序吧,Let GO:)<br>
            <br>
            &nbsp;&nbsp;&nbsp;  下面是我们VB+WINSCOKET控件写的一个简单的例子的源代码:<br>
            <br>
            -----------------------COOKIE SEND---------------------------------------<br>
            &nbsp;&nbsp;  Private Sub Command1_Click()<br>
            Winsock1.RemotePort = Text3.Text&nbsp;&nbsp;  &lt;|&gt;远程主机打开的端口一般都为80<br>
            Winsock1.RemoteHost = Text2.Text&nbsp;&nbsp;  &lt;|&gt;远程主机的域名也可以输IP<br>
            Winsock1.Connect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;|&gt;打开一个SOCKET连接<br>
            Command1.Enabled = False&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;|&gt;一次只能打开一个连接所以要让SEND按钮失效<br>
            End Sub<br>
            <br>
            Private Sub winsock1_Connect()<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Winsock1.SendData Text1.Text &lt;|&gt;打开连接成功的话就发送数据<br>
            End Sub<br>
            <br>
            Private Sub Command2_Click()<br>
            Winsock1.Close<br>
            Command1.Enabled = True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;|&gt;关闭连接,让SEND按钮有效<br>
            End Sub<br>
            <br>
            <br>
            Private Sub winsock1_DataArrival(ByVal bytesTotal As Long)&nbsp;&nbsp;&nbsp;&nbsp;  &lt;|&gt;接收数据,可以让我们检查数据是否发送成功<br>
            Dim tmpstr As String<br>
            Winsock1.GetData tmpstr<br>
            Text4.Text = tmpstr<br>
            End Sub<br>
            <br>
            -----------------------CUT HERE--------------------------------------------<br>
            <br>
            &nbsp;&nbsp;&nbsp;  好，再让我们看一看具体的过程吧:这儿要用到一个不错的程序WinSock Expert v0.3 beta 1<br>
            <br>
            一步：打开一个IE然后再打开winsock expert选择监视刚才打开的IE窗口的数据包<br>
            二步: 在IE地址栏输http://61.139.xx.xx/ring/admin.asp,那个我将看到发出了如下数据<br>
            <br>
            GET /ring/admin.asp HTTP/1.1<br>
            Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*<br>
            Accept-Language: zh-cn<br>
            Accept-Encoding: gzip, deflate<br>
            User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; </font><a class="wordstyle" href="http://www.newasp.cn/" target="_blank"><font face="宋体">Windows</font></a><font face="宋体"> 98)<br>
            Host: 61.139.xx.xx<br>
            Connection: Keep-Alive<br>
            <br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  不要半闭窗口请http://61.139.xx.xx/ring/level.asp，我们又将看到发出了如下数据<br>
            <br>
            GET /ring/level.asp HTTP/1.1<br>
            Accept: */*<br>
            Accept-Language: zh-cn<br>
            Accept-Encoding: gzip, deflate<br>
            User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; </font><a class="wordstyle" href="http://www.newasp.cn/" target="_blank"><font face="宋体">Windows</font></a><font face="宋体"> 98)<br>
            Host: 61.139.xx.xx<br>
            Connection: Keep-Alive<br>
            Cookie: level=user; ASPSESSIONIDSSTCRACS=ODMLKJMCOCJMNJIEDFLELACM<br>
            <br>
            三步： 好了对第二次发出的数据的最后一行Cookie: level=user; ASPSESSIONIDSSTCRACS=ODMLKJMCOCJMNJIEDFLELACM<br>
            就是我们要改的东东，由于level.asp中相应的COOKIE的检验语句为if request.cookies(&quot;level&quot;)=&quot;admin&quot; then<br>
            所以我们只要把上面的数据的最后一行改成Cookie: level=admin; ASPSESSIONIDSSTCRACS=ODMLKJMCOCJMNJIEDFLELACM<br>
            就可以了，后面的东东很重要下面我再说明一下:)<br>
            <br>
            四步: 把改过的数据拷到我编的程序的发送框里面输入端口和域名后。。。。。<br>
            <br>
            五步：到服务器看看是不是生成了那个a.txt里面的内容为&quot;you are admin!<br>
            <br>
            <br>
            好了不写了，主要还是自已多实验就可以了为了放便大家本文章的程序代码完全公开哈<br>
            <br>
            1.admin.asp和level.asp:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  http://locking.8u8.com/cookie/admin.txt和level.txt<br>
            2.cookieclient.exe及源代码: http://locking.8u8.com/cookie/cookiesend.zip<br>
            3.winsock expert: http://software.tom.com/download.asp?id=7500 或是 http://dxqsoft.myrice.com/ </font></div>
            </td>
        </tr>
    </tbody>
</table>
</div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%CD%F8%C2%E7%B3%CC%D0%F2">网络程序</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/3894a8fb2383372a4e4aea69.html#comment">查看评论</a>]]></description>
        <pubDate>2009-04-06  21:19</pubDate>
        <category><![CDATA[网络程序]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/3894a8fb2383372a4e4aea69.html</guid>
</item>

<item>
        <title><![CDATA[http://www.prototypejs.org]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/a593d9cee259d10b93457e7f.html]]></link>
        <description><![CDATA[
		
		<p><a href="http://www.prototypejs.org/">http://www.prototypejs.org</a></p>
<p>管方网站下载最新AJAX学习</p>
<p> </p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/a593d9cee259d10b93457e7f.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-19  10:00</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/a593d9cee259d10b93457e7f.html</guid>
</item>

<item>
        <title><![CDATA[ASP字符串函数大全]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/bdcd16f4eed2dde77609d793.html]]></link>
        <description><![CDATA[
		
		<div class="tit">ASP字符串函数大全</div>
<div class="date">2008-03-08 05:29 P.M.</div>
<table style="table-layout: fixed">
    <tbody>
        <tr>
            <td>
            <div class="cnt" >
            <p>函数 语法 功能 <br>
            Len Len(string|varname) 返回字符串内字符的数目，或是存储一变量所需的字节数。 <br>
            Trim Trim(string) 将字符串前后的空格去掉 <br>
            Ltrim Ltrim(string) 将字符串前面的空格去掉 <br>
            Rtrim Rtrim(string) 将字符串后面的空格去掉 <br>
            Mid Mid(string,start,length) 从string字符串的start字符开始取得length长度的字符串，如果省略第三个参数表示从start字符开始到字符串结尾的字符串 <br>
            Left Left(string,length) 从string字符串的左边取得length长度的字符串 <br>
            Right Right(string,length) 从string字符串的右边取得length长度的字符串 <br>
            LCase LCase(string) 将string字符串里的所有大写字母转化为小写字母 <br>
            UCase UCase(string) 将string字符串里的所有大写字母转化为大写字母 <br>
            StrComp StrComp(string1,string2[，compare]) 返回string1字符串与string2字符串的比较结果，如果两个字符串相同，则返回0，如果小于则返回-1，如果大于则返回1 <br>
            InStr InStr(string1,string2[,compare]) 返回string1字符串在string2字符串中第一次出现的位置 <br>
            Split Split(string1,delimiter[,count[,start]]) 将字符串根据delimiter拆分成一维数组，其中delimiter用于标识子字符串界限。如果省略，使用空格(&quot;&quot;)作为分隔符。count返回的子字符串数目，-1指示返回所有子字符串。start为1执行文本比较；如果为0或者省略执行二进制比较。 <br>
            Replace Replace(expression,find,replacewith[,compare[,count[,start]]]) 返回字符串，其中指定数目的某子字符串(find)被替换为另一个子字符串(replacewith)。</p>
            <p><br>
            补充：</p>
            <p>Asc Asc函数提取字符串第一个字母的ANSI字符码。<br>
            用法为：result = Asc(string)<br>
            其中result是字符码，string是任意有效的字符串表达式。如果string为Empty，则产生一个实时错误。</p>
            <p>AscB AscB函数提取字符串的第一个字节。<br>
            用法为：result = AscB(string)<br>
            其中result是Byte字类，string是任意有效的字符串表达式。如果string为Empty，则产生一个实时错误。</p>
            <p>AscW AscW函数提取字符串第一个字母的Unicode字符码。<br>
            用法为：result = AscW(string)<br>
            其中result是Unicode，string是任意有效的字符串表达式。如果string为Empty，则产生一个实时错误。</p>
            <p>InStr InStr函数识别某个记号在字符串中的首字母位置。<br>
            用法为：newstart = InStr([start, ]source, token[, compare])<br>
            其中newstart时记号在字符串中的位置（如果没有的话则为0），start是查找的起始位置，source是要查找的字符串，token是要定位的字符串，compare是比较类型（0表示二进制比较，1表示忽略大小写的文本比较）。</p>
            <p>InStrB InStrB函数是InStr的字节版，识别某个记号在字符串中的首字节位置。<br>
            用法为：newstart = InStrB([start, ]source, token[, compare])<br>
            其中newstart时记号在字符串中的首字节位置（如果没有的话则为0），start是查找的起始位置，source是要查找的字符串，token是要定位的字符串，compare是比较类型（0表示二进制比较，1表示忽略大小写的文本比较）。</p>
            <p>LCase LCase函数把字符串变为小写形式。<br>
            用法为：result = LCase(string)<br>
            其中result是小写字符串，string是任意有效的字符串表达式。</p>
            <p>Left Left函数从字符串的起始处提取指定数目的字符。<br>
            用法为：result = Left(string,length)<br>
            其中result是字符串变量，string是有效的字符串表达式，length是表示返回多少字符的数值型表达式。</p>
            <p>LeftB LeftB函数从字符串的起始处提取指定数目的字节。<br>
            用法为：result = LeftB(string,length)<br>
            其中result是字符串变量，string是有效的字符串表达式，length是表示提取的字节数的数值型表达式。</p>
            <p>Len Len函数确定字符串的大小或存储这个变量需要多少字符。<br>
            用法为：result = Len(string | varname)<br>
            其中，result是字符串中的字符数或存储这个变量所需的字节数，string是任意有效的字符串表达式，varname是变量名。</p>
            <p>LenB Len函数确定字符串的大小或存储这个变量需要多少字节。<br>
            用法为：result = LenB(string | varname)<br>
            其中，result是字符串中的字节数或存储这个变量所需的字节数，string是任意有效的字符串表达式，varname是变量名。</p>
            <p>LTrim LTrim函数复制字符串并去掉前面的空格。<br>
            用法为：result = LTrim(string)<br>
            其中，result是去掉空格后的字符串，string是要去掉空格的有效字符串表达式。</p>
            <p>Mid Mid函数从字符串的某个位置复制指定数目的字符。<br>
            用法为：result = Mid(string,start[,length])<br>
            其中，result是结果字符串，string是要从中复制字符的表达式，start是string中复制的起始位置，length是要复制的字符数。</p>
            <p>MidB Mid函数从字符串的某个位置复制指定数目的字节。<br>
            用法为：result = Mid(string,start[,length])<br>
            其中，result是结果字符串，string是要从中复制字节的表达式，start是string中复制的起始位置，length是要复制的字节数。</p>
            <p>Right Right函数从字符串的尾部提取指定数目的字符。<br>
            用法为：result = Right(string,length)<br>
            其中result是字符串变量，string是有效的字符串表达式，length是表示返回多少字符的数值型表达式。</p>
            <p>RightB RightB函数从字符串的起始处提取指定数目的字节。<br>
            用法为：result = RightB(string,length)<br>
            其中result是字符串变量，string是有效的字符串表达式，length是表示提取的字节数的数值型表达式。</p>
            <p>RTrim RTrim函数复制字符串并去掉尾部的空格。<br>
            用法为：result = RTrim(string)<br>
            其中，result是去掉空格后的字符串，string是要去掉空格的有效字符串表达式。</p>
            <p>String String函数构造含有多个相同字符的字符串。<br>
            用法为：result = String(number, character)<br>
            其中，result是字符串变量，number是返回字符串的长度，character是用来构造返回字符串的字符码。</p>
            <p>Trim Trim函数复制字符串并去掉首尾的空格。<br>
            用法为：result = Trim(string)<br>
            其中，result是去掉空格后的字符串，string是要去掉空格的有效字符串表达式。</p>
            <p>UCase UCase函数把字符串变为大写形式。<br>
            用法为：result = UCase(string)<br>
            其中result是大写字符串，string是任意有效的字符串表达式。</p>
            <p>asp字符串函数&nbsp;&nbsp;  [讨论]</p>
            <p>函数说明</p>
            <p>CBool</p>
            <p>数据转Boolean类型</p>
            <p>Cdate</p>
            <p>数据转Time类型</p>
            <p>CDbl</p>
            <p>数据转Double类型</p>
            <p>Cint</p>
            <p>数据转Integer类型</p>
            <p>CLng</p>
            <p>数据转Lang类型</p>
            <p>Asc</p>
            <p>字符转数字类型</p>
            <p>CStr</p>
            <p>数字转String类型</p>
            <p>Chr</p>
            <p>数字转字符类型</p>
            <p>Variant变量一般会将其代表的数据子类型自动转换成合适的数据类型,但有时候,自动转换也会造成一些数据类型不匹配的错误.这时,可使用转换函数来强制转换数据的子类型.</p>
            <p>函数 功能</p>
            <p>Asc 函数 返回与字符串的第一个字母对应的 ANSI 字符代码。</p>
            <p>Chr 函数 返回与指定的 ANSI 字符代码相对应的字符</p>
            <p>Hex 函数 返回表示十六进制数字值的字符串。</p>
            <p>Oct 函数 返回表示数字八进制值的字符串。</p>
            <p>CStr 函数 返回表达式，该表达式已被转换为 字符串 子类型。</p>
            <p>CDate 函数 返回表达式，此表达式已被转换为 日期 子类型。</p>
            <p>CInt 函数 返回表达式，此表达式已被转换为 整数 子类型。</p>
            <p>CLng 函数 返回表达式，此表达式已被转换为 长整数 子类型</p>
            <p>CSng 函数 返回表达式，该表达式已被转换为 Single 子类型</p>
            <p>CDbl 函数 返回表达式，此表达式已被转换为 Double 子类型</p>
            <p>CBool 函数 返回表达式，此表达式已转换为 布尔 子类型</p>
            <p>1、Asc 函数示例</p>
            <p>下面例子中, Asc 返回每一个字符串首字母的 ANSI 字符代码:</p>
            <p>Dim MyNumber</p>
            <p>MyNumber = Asc(&quot;A&quot;) '返回 65。</p>
            <p>MyNumber = Asc(&quot;a&quot;) '返回 97。</p>
            <p>MyNumber = Asc(&quot;Apple&quot;) '返回 65。</p>
            <p>2、Chr 函数示例</p>
            <p>下面例子利用 Chr 函数返回与指定的字符代码相对应的字符:</p>
            <p>Dim MyChar</p>
            <p>MyChar = Chr(65) '返回 A。</p>
            <p>MyChar = Chr(97) '返回 a。</p>
            <p>MyChar = Chr(62) '返回 &gt;。</p>
            <p>MyChar = Chr(37) '返回 %。</p>
            <p>3、Hex 函数示例</p>
            <p>下面的示例利用 Hex 函数返回数字的十六进制数：</p>
            <p>Dim MyHex</p>
            <p>MyHex = Hex(5) ' 返回 5。</p>
            <p>MyHex = Hex(10) ' 返回A。</p>
            <p>MyHex = Hex(459) ' 返回 1CB。</p>
            <p>4、Oct 函数示例</p>
            <p>下面的示例利用 Oct 函数返回数值的八进制数：</p>
            <p>Dim MyOct</p>
            <p>MyOct = Oct(4) ' 返回 4。</p>
            <p>MyOct = Oct(8) ' 返回 10。</p>
            <p>MyOct = Oct(459) ' 返回 713。</p>
            <p>5、 CStr 函数示例</p>
            <p>&lt;%num1=666StrWelcome=&quot;欢迎第&quot;&amp;CStr(num1)&amp;&quot;个来访者&quot;%&gt;</p>
            <p>CStr将变量num1由整数子类型强制转换为字符串子类型</p>
            <p>6、CDate 函数示例</p>
            <p>MyDate = &quot;October 19, 1962&quot; ' 定义日期。</p>
            <p>MyShortDate = CDate(MyDate) ' 转换为日期数据类型。</p>
            <p>MyTime = &quot;4:35:47 PM&quot; ' 定义时间。</p>
            <p>MyShortTime = CDate(MyTime) ' 转换为日期数据类型。</p>
            <p>7、CInt 函数示例</p>
            <p>Dim MyDouble, MyInt</p>
            <p>MyDouble = 2345.5678 ' MyDouble 是 Double。</p>
            <p>MyInt = CInt(MyDouble) ' MyInt 包含 2346。</p>
            <p>8、CLng 函数示例</p>
            <p>Dim MyVal1, MyVal2, MyLong1, MyLong2</p>
            <p>MyVal1 = 25427.45: MyVal2 = 25427.55 ' MyVal1, MyVal2 是双精度值。</p>
            <p>MyLong1 = CLng(MyVal1) ' MyLong1 25427。</p>
            <p>MyLong2 = CLng(MyVal2) ' MyLong2 包含 25428 。</p>
            <p>9、CBool 函数示例</p>
            <p>Dim A, B, Check</p>
            <p>A = 5: B = 5 ' 初始化变量。</p>
            <p>Check = CBool(A = B) '复选框设为 True 。</p>
            <p>A = 0 '定义变量。</p>
            <p>Check = CBool(A) '复选框设为 False</p>
            </div>
            </td>
        </tr>
    </tbody>
</table> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/bdcd16f4eed2dde77609d793.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-09  10:28</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/bdcd16f4eed2dde77609d793.html</guid>
</item>

<item>
        <title><![CDATA[常用二级分类下拉列表[数据库版]]]></title>
        <link><![CDATA[http://hi.baidu.com/%B9%D6%CA%AF/blog/item/6a67323880d41723b9998f38.html]]></link>
        <description><![CDATA[
		
		&lt;% <br>
&rsquo;************************************************** <br>
&rsquo;常用二级分类下拉列表[数据库版] <br>
&rsquo;叶随风(LeafinWind) <br>
&rsquo;QQ：19855466 <br>
&rsquo;http://www.popasp.com/ <br>
&rsquo;说明： <br>
&rsquo;支持多浏览器 <br>
&rsquo;所有类别信息在同一个表中 <br>
&rsquo;表结构：InfoClass[表名] <br>
&rsquo;ID：&nbsp;&nbsp;  自动编号 <br>
&rsquo;ClassName： 类别名称[文本] <br>
&rsquo;PID：&nbsp;&nbsp;  父类id号[数字] <br>
&rsquo;ClassIndex： 类别索引[数字]，用于排序，可有可无 <br>
&rsquo;************************************************** <br>
Dim SubClsCount, rsCl <br>
Set rsCl = Server.Createobject(&quot;Adodb.Recordset&quot;)  <br>
rsCl.Open &quot;Select * From [InfoClass] Where PID &lt;&gt; 0 Order By ClassIndex, ID&quot;,Conn,1,1&nbsp;&nbsp;&nbsp;  &rsquo;小类 <br>
%&gt;  <br>
&lt;script language = &quot;JavaScript&quot;&gt;  <br>
var TCount = 0;  <br>
subCls = new Array();  <br>
&lt;%  <br>
SubClsCount = 0 <br>
Do While Not rsCl.Eof  <br>
 %&gt; <br>
 //数组中三个元素的说明：(小类ID：小类Select的value内容，小类父ID：所属的大类的ID，小类名称：Select列表显示的内容) <br>
 subCls[&lt;%=SubClsCount%&gt;] = new Array(&quot;&lt;%=Trim(rsCl(&quot;ID&quot;))%&gt;&quot;,&quot;&lt;%=rsCl(&quot;PID&quot;)%&gt;&quot;,&quot;&lt;%=Trim(rsCl(&quot;ClassName&quot;))%&gt;&quot;);  <br>
 &lt;%  <br>
 SubClsCount = SubClsCount + 1 <br>
 rsCl.Movenext  <br>
Loop  <br>
rsCl.Close <br>
Set rsCl = Nothing <br>
%&gt;  <br>
TCount=&lt;%=SubClsCount%&gt;;  <br>
function changelocation(locationid)  <br>
{  <br>
 document.getElementById(&quot;SmallClassID&quot;).length = 0;  <br>
 var locationid = locationid;  <br>
 var i; <br>
 for (i=0;i &lt; TCount; i++)  <br>
 {  <br>
  if (subCls[i][1] == locationid)  <br>
  {  <br>
&nbsp;&nbsp;  //（前边：字段三内容，显示在列表中；后边：字段一内容，显示在VALUE值中！） <br>
&nbsp;&nbsp;  document.getElementById(&quot;SmallClassID&quot;).options[document.getElementById(&quot;SmallClassID&quot;).length] = new Option(subCls[i][2], subCls[i][0]);  <br>
  } <br>
 } <br>
 if (document.getElementById(&quot;SmallClassID&quot;).options.length &lt;= 0) <br>
 { <br>
  document.getElementById(&quot;SmallClassID&quot;).options[document.getElementById(&quot;SmallClassID&quot;).length] = new Option(&quot;暂无小类&quot;, 0); <br>
 } <br>
}  <br>
&lt;/script&gt; <br>
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt; <br>
&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot;&gt; <br>
&lt;head&gt; <br>
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt; <br>
&lt;title&gt;ASP+JS的二级分类&lt;/title&gt; <br>
&lt;/head&gt; <br>
&lt;body&quot;&gt; <br>
&lt;% <br>
Dim SelClassID <br>
Set rsCl = Server.Createobject(&quot;Adodb.Recordset&quot;)  <br>
rsCl.Open &quot;Select * From [InfoClass] Where PID = 0 Order By ClassIndex, ID&quot;,Conn,1,1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &rsquo;大类 <br>
If rsCl.Eof And rsCl.Bof Then  <br>
 Response.Write &quot;请添加顶级（大）类别!&quot;  <br>
 Response.End() <br>
Else <br>
 %&gt; <br>
 大类： <br>
 &lt;select name=&quot;BigClassID&quot; size=&quot;1&quot; id=&quot;BigClassID&quot; onChange=&quot;changelocation(document.getElementById(&rsquo;BigClassID&rsquo;).options[document.getElementById(&rsquo;BigClassID&rsquo;).selectedIndex].value)&quot;&gt; <br>
&nbsp;&nbsp;&nbsp;  &lt;% <br>
 SelClassID = rsCl(&quot;ID&quot;)  <br>
 Do While Not rsCl.Eof  <br>
  %&gt; <br>
&nbsp;&nbsp;&nbsp;  &lt;option value=&quot;&lt;%=rsCl(&quot;ID&quot;)%&gt;&quot;&gt;&lt;%=rsCl(&quot;ClassName&quot;)%&gt;&lt;/option&gt; <br>
&nbsp;&nbsp;&nbsp;  &lt;%  <br>
  rsCl.Movenext  <br>
 Loop  <br>
 %&gt; <br>
 &lt;/select&gt; <br>
 &lt;% <br>
End If  <br>
rsCl.Close  <br>
%&gt; <br>
小类： <br>
&lt;% <br>
Dim SmallClassList <br>
SmallClassList = &quot;&lt;select name=SmallClassID id=SmallClassID&gt;&quot; <br>
rsCl.Open &quot;Select * From [InfoClass] Where PID = &quot;&amp;SelClassID&amp;&quot; Order By ClassIndex, ID&quot; ,Conn,1,1&nbsp;&nbsp;&nbsp;  &rsquo;小类 <br>
If Not (rsCl.Eof And rsCl.Bof) Then  <br>
 Do While Not rsCl.Eof <br>
  SmallClassList = SmallClassList &amp; &quot;&lt;option value=&rsquo;&quot;&amp;rsCl(&quot;ID&quot;)&amp;&quot;&rsquo;&gt;&quot;&amp;rsCl(&quot;ClassName&quot;)&amp;&quot;&lt;/option&gt;&quot; <br>
  rsCl.Movenext  <br>
 Loop  <br>
Else <br>
 SmallClassList = SmallClassList &amp; &quot;&lt;option value=&rsquo;0&rsquo;&gt;暂无小类&lt;/option&gt;&quot; <br>
End If  <br>
rsCl.Close  <br>
Set rsCl = Nothing <br>
SmallClassList = SmallClassList &amp; &quot;&lt;/select&gt;&quot; <br>
Response.Write(SmallClassList) <br>
%&gt; <br>
&lt;/body&gt; <br>
&lt;/html&gt; 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/category/%CD%F8%C2%E7%B3%CC%D0%F2">网络程序</a>&nbsp;<a href="http://hi.baidu.com/%B9%D6%CA%AF/blog/item/6a67323880d41723b9998f38.html#comment">查看评论</a>]]></description>
        <pubDate>2009-02-27  10:35</pubDate>
        <category><![CDATA[网络程序]]></category>
        <author><![CDATA[guaishi]]></author>
		<guid>http://hi.baidu.com/%B9%D6%CA%AF/blog/item/6a67323880d41723b9998f38.html</guid>
</item>


</channel>
</rss>