<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[ChinaCMS.org]]></title>
<link>http://www.chinacms.org/</link>
<description><![CDATA[左手程序,右手诗]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog2 v2.4]]></copyright>
<webMaster><![CDATA[ch_56@sina.com(西楼冷月)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>ChinaCMS.org</title> 
	<url>http://www.chinacms.org/images/logos.gif</url> 
	<link>http://www.chinacms.org/</link> 
	<description>ChinaCMS.org</description> 
</image>

			<item>
			<link>http://www.chinacms.org/default.asp?id=241</link>
			<title><![CDATA[asp单点登陆(sso)问题]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Tue,11 Nov 2008 15:23:18 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=241</guid>	
		<description><![CDATA[公司要实行一个asp通行证平台，查了不少的资料，总结一下：<br/>1,不论是注册，登陆，注销都要返回在通行证中心进行<br/>2,不论用什么方法实现，都要在通行中心使用cookie记录用户登陆状态，因为成员网站发现用户没登陆时都要转到通行证中心进行验证用户是否已经登陆过<br/>3,成员站点和通行证中心进行通信验证仍然要用url附带参数来传递，因为是明文传递的，所以要实现加密解密来验证数据的合法性。<br/>4,不要以为使用asp的xmlhttp可以进行远程登陆就认为可以实现sso，其实用这种方法是会遇到其他问题的，这个方法行不通<br/>5,要在成员站点使用到iframe或&lt;script src=&#34;passport.asp&#34;&gt;&lt;/script&gt;的形式包含通行证中心的页面，这样就维持通行证中心用来保存用户登陆的cookie状态不过期<br/>6,在成员网站不能使用ajax来登陆了，只能使用iframe代替，这个真是个很大的遗憾，或许有方法的，只是我还没想到。<br/><br/>目前想到的实现思路有两个：<br/>1,通行证中心和各成员站点都使用cookie保存用户登陆状态<br/>2,第一种方法的扩展，除了使用cookie还要把用户登陆状态记录到数据库，这样b/s和c/s都能登陆，但是要维护状态的同步性，暂时没想到什么好的方法<br/><br/>有点乱，等把系统实现后有时间再整理个方案出来。]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=238</link>
			<title><![CDATA[discuz编辑器背景修改问题]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Sat,08 Nov 2008 17:10:51 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=238</guid>	
		<description><![CDATA[discuz6.1编辑器默认是[所见即所得模式],当在样式里定义body{}有背景图片的时候,那在编辑器的编辑框里也会出现背景图片。<br/>解决办法：<br/>找到&#34;include/javascript/editor.js&#34;,大概136行开始，是定义编辑框样式的，代码如下：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>editbox.style.width = textobj.style.width;<br/>editbox.style.height = textobj.style.height;<br/>editdoc.body.style.backgroundColor = TABLEBG;<br/>editdoc.body.style.textAlign = &#39;left&#39;;<br/>editdoc.body.id = &#39;wysiwyg&#39;;<br/></div></div><br/>在这些代码后面加：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>editdoc.body.style.backgroundImage = &#34;none&#34;;<br/></div></div><br/>即可。<br/><br/><br/>另外：怎样定义discuz编辑器框的外框样式？<br/>在后台样式里加上：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>#posteditor_iframe{border:solid 1px #F7F7F7;}<br/></div></div><br/>可以定义边框样式，也可以定义滚动条样式，具体自己加。<br/><br/>也许会有疑问为什么这样加，因为discuz所见即所得模式的编辑器是由javascript动态创建的iframe,而这个iframe的id就是posteditor_iframe,还有，这个id的定义是在/post.php的第193行的$editorid = &#39;posteditor&#39;加上&#34;_iframe&#34;后缀.^_^<br/><br/>OVER...by xilou]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=237</link>
			<title><![CDATA[安装UCenter时提示:Unknown character set: \’gbk\’]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Fri,07 Nov 2008 10:23:38 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=237</guid>	
		<description><![CDATA[安装UCenter_1.0.0_SC_GBK程序时提示:Unknown character set: \’gbk\’,试了几次都不行，又是数据库编码问题，看来又要手动hack安装了。具体如下：<br/><br/>1，在安装的第二步时出现错误，打开install/index.php，在大概321行找到下面代码：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>if($curr_mysql_version &gt; &#39;4.1&#39;) {<br/>&#160;&#160;&#160;&#160;mysql_query(&#34;Cr&#101;ate DATABASE IF NOT EXISTS `$ucdbname` DEFAULT CHARACTER SET $ucdbcharset&#34;);<br/>} else {<br/>&#160;&#160;&#160;&#160;mysql_query(&#34;Cr&#101;ate DATABASE IF NOT EXISTS `$ucdbname`&#34;);<br/>}<br/></div></div><br/><br/><img src="http://www.chinacms.org/attachments/month_0811/q2008117102542.gif" border="0" alt=""/><br/><br/>将&#34;DEFAULT CHARACTER SET $ucdbcharset&#34;去掉或拿出来注释掉，变成如下：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>if($curr_mysql_version &gt; &#39;4.1&#39;) {<br/>&#160;&#160;&#160;&#160;mysql_query(&#34;Cr&#101;ate DATABASE IF NOT EXISTS `$ucdbname` &#34;);//DEFAULT CHARACTER SET $ucdbcharset<br/>} else {<br/>&#160;&#160;&#160;&#160;mysql_query(&#34;Cr&#101;ate DATABASE IF NOT EXISTS `$ucdbname`&#34;);<br/>}<br/></div></div><br/><br/>2，在安装的第四步再次出现这个错误，打开install/global.func.php,在大概321行找到下面代码：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>function cr&#101;atetable($sql, $dbcharset) {<br/>&#160;&#160;&#160;&#160;$type = strtoupper(preg_replace(&#34;/^\s*Cr&#101;ate TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU&#34;, &#34;\\2&#34;, $sql));<br/>&#160;&#160;&#160;&#160;$type = in_array($type, array(&#39;MYISAM&#39;, &#39;HEAP&#39;)) ? $type : &#39;MYISAM&#39;;<br/>&#160;&#160;&#160;&#160;return preg_replace(&#34;/^\s*(Cr&#101;ate TABLE\s+.+\s+\(.+?\)).*$/isU&#34;, &#34;\\1&#34;, $sql).<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(mysql_get_server_info() &gt; &#39;4.1&#39; ? &#34; ENGINE=$type DEFAULT CHARSET=$dbcharset&#34; : &#34; TYPE=$type&#34;);<br/>}</div></div><br/><br/><img src="http://www.chinacms.org/attachments/month_0811/d2008117102626.gif" border="0" alt=""/><br/><br/>将&#34;DEFAULT CHARSET=$dbcharset&#34;去掉或拿出来注释掉，变成如下：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">function cr&#101;atetable($sql, $dbcharset) {<br/>&#160;&#160;&#160;&#160;$type = strtoupper(preg_replace(&#34;/^\s*Cr&#101;ate TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU&#34;, &#34;\\2&#34;, $sql));<br/>&#160;&#160;&#160;&#160;$type = in_array($type, array(&#39;MYISAM&#39;, &#39;HEAP&#39;)) ? $type : &#39;MYISAM&#39;;<br/>&#160;&#160;&#160;&#160;return preg_replace(&#34;/^\s*(Cr&#101;ate TABLE\s+.+\s+\(.+?\)).*$/isU&#34;, &#34;\\1&#34;, $sql).<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(mysql_get_server_info() &gt; &#39;4.1&#39; ? &#34; ENGINE=$type &#34; : &#34; TYPE=$type&#34;);//DEFAULT CHARSET=$dbcharset<br/>}</div></div><br/><br/>OK，大功告成!!<br/>]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=236</link>
			<title><![CDATA[从cnbeta上看到的.]]></title>
			<author>ch_56@sina.com(杜宝)</author>
			<category><![CDATA[生活]]></category>
			<pubDate>Thu,06 Nov 2008 15:06:27 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=236</guid>	
		<description><![CDATA[Dear Tim, <br/><br/>shall by too dull doll by too jack won, <br/>dolphin long can Jim shall by too low, shall by too when dull low, doll car low, dolphin long doll Ham Eason “more power!”<br/><br/>能看懂不?]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=235</link>
			<title><![CDATA[关于周末的郊游...]]></title>
			<author>ch_56@sina.com(杜宝)</author>
			<category><![CDATA[生活]]></category>
			<pubDate>Thu,06 Nov 2008 13:22:33 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=235</guid>	
		<description><![CDATA[经理 说:<br/>周六研发组织爬香山,你去吗?问问他们?<br/>杜宝 说:<br/>好.我问问<br/>杜宝 说:<br/>没人<br/>杜宝 说:<br/>又没漂亮MM.同志们纷纷表示对研发那帮大老爷们没兴趣<br/>经理 说:<br/>你问问女的.<br/>杜宝 说:<br/>女的也不去.<br/>经理 说:<br/>理由?<br/>杜宝 说:<br/>对香山没兴趣,对研发那帮大老爷们也没兴趣<br/>经理 说:<br/>明白]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=232</link>
			<title><![CDATA[自家用的asp函数库，不断增加中...]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Thu,30 Oct 2008 14:37:10 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=232</guid>	
		<description><![CDATA[<div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/html.gif" style="margin:0px 2px -3px 0px"> HTML代码</div><div class="UBBContent"><TEXTAREA rows="8" id="temp45925">
<%
    '******************************
    '类名：
    '名称：通用库
    '日期：2008/10/28
    '作者：by xilou
    '网址：
    '描述：通用库
    '版权：转载请注名出处，作者
    '******************************
    '最后修改：
    '修改次数：
    '修改说明：
    '目前版本：
    '******************************/

    '输出
    Sub Echo(str)
        Response.Write str
    End Sub

    '断点
    Sub Halt()
        Response.End()
    End Sub

    '输出并换行
    Sub Br(str)
        Echo str &amp; &#34;<br />&#34; &amp; vbcrlf
    End Sub

    '简化Request.Form()
    'f : 表单名称
    Function P(f)
        P = Replace(Request.Form(f), Chr(0), &#34;&#34;)
    End Function

    '接收表单并替换单引号
    Function Pr(f)
        Pr = Replace(Request.Form(f), Chr(0), &#34;&#34;)
        Pr = Replace(Pr, &#34;'&#34;, &#34;''&#34;)
    End Function

    '简化Request.Querystring()
    'f : 表单名称
    Function G(f)
        G = Replace(Request.QueryString(f), Chr(0), &#34;&#34;)
    End Function

    '接收url参数并替换单引号
    Function Gr(f)
        Gr = Replace(Request.QueryString(f), Chr(0), &#34;&#34;)
        Gr = Replace(Gr, &#34;'&#34;, &#34;''&#34;)
    End Function

    '//构造()?:三目运算 by xilou www.chinacms.org
    'ifThen为true返回s1,为false返回s2
	Function IfThen(ifTrue, s1, s2)
		Dim t
		If ifTrue Then
			t = s1
		Else
			t = s2
		End If
		IfThen = t
	End Function

    '显示不同颜色的是和否
	Function IfThenFont(ifTrue, s1, s2)
	    Dim str
	    If ifTrue Then
		    str = &#34;<font color=&#34;&#34;#006600&#34;&#34;>&#34; &amp; s1 &amp; &#34;</font>&#34;
		Else
		    str = &#34;<font color=&#34;&#34;#FF0000&#34;&#34;>&#34; &amp; s2 &amp; &#34;</font>&#34;
		End If
		IfThenFont = str
	End Function

    '创建Dictionary对象
    Function HashTable()
        Set HashTable = Server.Cr&#101;ateObj(&#34;Scripting.Dictionary&#34;)
        HashTable.CompareMode = 1
    End Function

    '创建XmlHttp
    Function XmlHttp()
        Set XmlHttp = Server.cr&#101;ateobject(&#34;MSXML2.XMLHTTP&#34;)
    End Function

    '创建XmlDom
    Function XmlDom()
    End Function

    '创建AdoStream
    Function AdoStream()
        Set AdoStream = Server.Cr&#101;ateObject(&#34;Adodb.Stream&#34;)
    End Function

    '创建一个1维数组
	'返回n个元素的空数组
	'n : 元素个数
	Function NewArray(n)
	    Dim ary : ary = array()
		ReDim ary(n-1)
		NewArray = ary
	End Function

    '构造Try..Catch
    Sub Try()
        On Error Resume Next
    End Sub

    '构造Try..Catch
    Sub Catch(msg)
        Dim html
        html = &#34;<ul><li>$1</li></ul>&#34;
        If Err Then
            If msg <> &#34;&#34; Then
                echo Replace(html, &#34;$1&#34;, msg)
                Halt
            Else
                echo Replace(html, &#34;$1&#34;, Err.Description)
                Halt
            End If
            Err.Clear
            Response.End()
        End If
    End Sub

    '--------------------------------数组操作开始
    '判断数组中是否存在某个值
	Function InArray(arr, s)
	    If VarType(arr) <> 8192 Then InArray = False : Exit Function
	    Dim i
	    For i = LBound(arr) To UBound(arr)
		    If s = arr(i) Then InArray = True : Exit Function
		Next
		InArray = False
	End Function

    '用ary数组中的值分别替换str中的占位符
    '返回替换后的字符串
    'str:要替换的字符串,占位符分别为$0,$1,$2...
    'ary:用来替换的数组,每个值分别对应占位符中的$0,$1,$2...
    '如:ReplaceByAry(&#34;$0-$1-$2 $3:$4:$5&#34;,Array(y,m,d,h,i,s))
    Function ReplaceByAry(str,ary)
        Dim i, j, L1, L2 : j = 0
        If IsArray(ary) Then
		    L1 = LBound(ary) : L2 = UBound(ary)
			For i = L1 To L2
				str = Replace(str, &#34;$&#34;&amp;j, ary(i))
			    j   = j+1
			Next
	    End If
	    ReplaceByAry = str
    End Function
    '--------------------------------数组操作结束

    '--------------------------------随机数操作开始
    '获取随机数
    'm-n的随机数字
    Function RndNumber(m,n)
        Randomize
        RndNumber = Int((n - m + 1) * Rnd + m)
    End Function

    '获取随机字符串
    'n : 产生的长度
    Function RndText(n)
        Dim str1, str2, i, x, L
        str1 = &#34;NOPQRSTUVWXYZ012ABCDEFGHIJKLM3456abcdefghijklm789nopqrstuvwxyz&#34;
        L    = Len(str1)
        Randomize
        For i = 1 To n
            x    = Int((L - 1 + 1) * Rnd + 1)
            str2 = str2 &amp; Mid(str1,x,1)
        Next
        RndText = str2
    End Function

    '从字符串str中产生m至n个的随机字符串
    '如果str为空则默认从数字和字母中产生随机字符串
    'str : 要从该字符串中产生随机字符串
    'm,n : 产生n到m位
    Function RndByText(str, m, n)
        Dim i, k, str2, L, x
        If str = &#34;&#34; Then str = &#34;NOPQRSTUVWXYZ012ABCDEFGHIJKLM3456abcdefghijklm789nopqrstuvwxyz&#34;
        L = Len(str)
        If n = m Then
            k = n
        Else
            Randomize
            k = Int((n - m + 1) * Rnd + m)
        End If
        Randomize
        For i = 1 To k
            x    = Int((L - 1 + 1) * Rnd + 1)
            str2 = str2 &amp; Mid(str, x, 1)
        Next
        RndByText = str2
    End Function

    '日期时间组成随机数
    '返回当前时间的数字组合
    Function RndByDateTime()
        Dim dt : dt  = Now()
        RndByDateTime = Year(dt) &amp; Month(dt) &amp; Day(dt) &amp; Hour(dt) &amp; Minute(dt) &amp; Second(dt)
    End Function
    '--------------------------------随机数操作结束

    '--------------------------------字符串操作开始
    '判断一字符串str2在另一个字符串str1中出现的次数
	'返回次数，没有则返回0
	'str1 :接受搜索的字符串表达式
	'str2 :要搜索的字符串表达式
	'start:要搜索的开始位置,为空表示默认从1开始搜索
	Function InStrTimes(str1, str2, start)
	    Dim a,c
		If start = &#34;&#34; Then start = 1
		c = 0
		a = InStr(start, str1, str2)
		Do While a > 0
		    c = c + 1
			a = InStr(a+1, str1, str2)
		Loop
		InStrTimes = c
	End Function

    '字符串连接
	'无返回
	'strResult : 连接后保存的字符
	'str       : 要连接的字符
	'partition : 连接字符间的分割符号
	Sub JoinStr(byref strResult,str,partition)
	    If strResult <> &#34;&#34; Then
		    strResult = strResult &amp; partition &amp; str
		Else
		    strResult = str
		End If
	End Sub

    '计算字符串的字节长度，一个汉字=2字节
    Function StrLen(str)
        If isNull(str) o&#114; Str = &#34;&#34; Then
            StrLen = 0
            Exit Function
        End If
        Dim WINNT_CHINESE
        WINNT_CHINESE = (len(&#34;例子&#34;)=2)
        If WINNT_CHINESE Then
            Dim l,t,c
            Dim i
            l = len(str)
            t = l
            For i = 1 To l
                c = asc(mid(str,i,1))
                If c<0 Then c = c + 65536
                If c>255 Then t = t + 1
            Next
            StrLen = t
        Else
            StrLen = len(str)
        End If
    End Function

    '截取字符串
    ' str    : 要截取的字符串
    ' strlen : 要截取的长度
    ' addStr : 超过长度的用这个代替，如:...
	Function CutStr(str, strlen, addStr)
		Dim l, t, c
		'str=str&amp;&#34;&#34;
		If Is_Empty(str) Then CutStr = &#34;&#34; : Exit Function
		If str=&#34;&#34; o&#114; IsEmpty(str) Then CutStr=&#34;&#34; : Exit Function
		'On Error Resume Next
		l = len(str) : t = 0
		For i=1 To l
			c = Abs(Asc(Mid(str,i,1)))
			If c > 255 Then
				t = t+2
			Else
				t = t+1
			End If
			If t > strlen Then
				CutStr = left(str, i) &amp; addStr
				Exit For
			Else
				CutStr = str
			End If
		Next
		'If Err Then Err.Clear:CutStr=Left(str,strlen)
	End Function

    '全角转换成半角
	Function SBCcaseConvert(str)
		Dim b, c, i
		b = &#34;１,２,３,４,５,６,７,８,９,０,&#34; _
		&amp;&#34;Ａ,Ｂ,Ｃ,Ｄ,Ｅ,Ｆ,Ｇ,Ｈ,Ｉ,Ｊ,Ｋ,Ｌ,Ｍ,Ｎ,Ｏ,Ｐ,Ｑ,Ｒ,Ｓ,Ｔ,Ｕ,Ｖ,Ｗ,Ｘ,Ｙ,Ｚ&#34;
		c = &#34;1,2,3,4,5,6,7,8,9,0,&#34; _
		&amp;&#34;A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z&#34;
		b = split(b,&#34;,&#34;)
		c = split(c,&#34;,&#34;)
		For i = 0 To Ubound(b)
			If instr(str,b(i)) > 0 Then
				str = Replace(str, b(i), c(i))
			End If
		Next
		SBCcaseConvert = str
	End Function

    '与javascript中的escape()等效
	Function VbsEscape(str)
		dim i,s,c,a
		s=&#34;&#34;
		For i=1 to Len(str)
			c = Mid(str,i,1)
			a = ASCW(c)
			If (a>=48 and a<=57) o&#114; (a>=65 and a<=90) o&#114; (a>=97 and a<=122) Then
				s = s &amp; c
			ElseIf InStr(&#34;@*_+-./&#34;,c) > 0 Then
				s = s &amp; c
			ElseIf a>0 and a<16 Then
				s = s &amp; &#34;%0&#34; &amp; Hex(a)
			ElseIf a>=16 and a<256 Then
				s = s &amp; &#34;%&#34; &amp; Hex(a)
			Else
				s = s &amp; &#34;%u&#34; &amp; Hex(a)
			End If
		Next
		VbsEscape = s
	End Function

	'对javascript中使用escape()编码过的数据进行解码,ajax调用时用
	Function VbsUnEscape(str)
	    Dim x
		x=InStr(str,&#34;%&#34;)
		Do While x > 0
			VbsUnEscape = VbsUnEscape &amp; Mid(str,1,x-1)
			If LCase(Mid(str,x+1,1)) = &#34;u&#34; Then
				VbsUnEscape = VbsUnEscape&amp;ChrW(CLng(&#34;&amp;H&#34;&amp;Mid(str,x+2,4)))
				str = Mid(str,x+6)
			Else
				VbsUnEscape = VbsUnEscape&amp;Chr(CLng(&#34;&amp;H&#34;&amp;Mid(str,x+1,2)))
				str = Mid(str,x+3)
			End If
			x = InStr(str,&#34;%&#34;)
		Loop
		VbsUnEscape = VbsUnEscape&amp;str
	End Function
    '--------------------------------字符串操作结束

    '--------------------------------时间日期操作开始
    '根据年份和月份获得相应的月份天数
	'返回天数
	'y : 年份,如：2008
	'm : 月份,如：3
	Function GetDayCount(y,m)
	    Dim c
	    Sel&#101;ct Case m
	    Case 1, 3, 5, 7, 8, 10, 12
		    c=31
		Case 2
		    If IsDate(y&amp;&#34;-&#34;&amp;m&amp;&#34;-&#34;&amp;&#34;29&#34;) Then
			    c = 29
			Else
			    c = 28
			End If
		Case Else
		    c = 30
	    End Sel&#101;ct
		GetDayCount = c
	End Function

    '判断一个日期时间是否在某段时间之间,包括比较的两头时间
	Function IsBetweenTime(fromTime,toTime,strTime)
	    If DateDiff(&#34;s&#34;,fromTime,strTime) >= 0 And DateDiff(&#34;s&#34;,toTime,strTime) <= 0 Then
		    IsBetweenTime = True
		Else
		    IsBetweenTime = False
		End If
	End Function
    '--------------------------------时间日期操作结束

    '--------------------------------安全加密相关操作开始
    '加密串,要使用MD5()函数
    Function iEncrypt()
        Dim ary(3),i,str,str1,str2,n,s,s1,s2
        For i = 0 To 3
            ary(i) = RndText(5)
            str    = str&amp;Asc(mid(ary(i),2,1))
        Next

        str1 = ary(0)&amp;ary(2)
        str2 = ary(1)&amp;ary(3)
        For i = 1 To Len(str1) - 1
            s1 = Asc(mid(str1,i,1))
            s2 = Asc(mid(str2,i,1))
            n  = s1 Xor s2
            s  = s &amp; chr(n)
        Next
        iEncrypt = Join(ary,&#34;,&#34;)&amp;&#34;,&#34;&amp;MD5(s&amp;EncryptKey&amp;str)
    End Function

    '验证加密串的正确性
    '返回 True | False
    'str : 要验证的字符串,8qp2b,ruZwh,kICkU,xzM1B,174d5e97ebb8e163
    Function iValidate(strText)
        Dim ary,i,L,str,str1,str2,n,s,s1,s2,oldText
        If strText = &#34;&#34; Then iValidate = False : Exit Function
        ary = Split(strText,&#34;,&#34;)
        L = UBound(ary)
        If L <> 4 Then iValidate = False : Exit Function
        For i = 0 To 3
            str    = str&amp;Asc(mid(ary(i),2,1))
        Next
        str1 = ary(0)&amp;ary(2)
        str2 = ary(1)&amp;ary(3)
        For i = 1 To Len(str1) - 1
            s1 = Asc(mid(str1,i,1))
            s2 = Asc(mid(str2,i,1))
            n  = s1 Xor s2
            s  = s &amp; chr(n)
        Next
        oldText = MD5(s&amp;EncryptKey&amp;str)
        If oldText = ary(4) Then
            iValidate = True
        Else
            iValidate = False
        End If
    End Function
    '--------------------------------安全加密相关操作结束

    '--------------------------------数据合法性验证操作开始
    '--------------------------------数据合法性验证操作结束

    '--------------------------------文件操作开始
    '获取文件后缀，如jpg
    Function GetFileExt(f)
        GetFileExt = Lcase(Mid(f,InStrRev(f,&#34;.&#34;) + 1))
    End Function
    '--------------------------------文件操作结束

    '--------------------------------其他操作开始
    '显示信息
    'message : 要显示的信息
    'url     : 要跳转的URL
    'typeNum : 显示方式，1弹出信息，回退到上一页；2弹出信息，转到url处
    Sub ShowMsg(message,url,typeNum)
        message = replace(message,&#34;'&#34;,&#34;\'&#34;)
        Sel&#101;ct Case TypeNum
        Case 1
           echo (&#34;<script language=javascript>alert('&#34; &amp; message &amp; &#34;');history.go(-1)</script>&#34;)
        Case 2
           echo (&#34;<script language=javascript>alert('&#34; &amp; message &amp; &#34;');location='&#34; &amp; Url &amp;&#34;'</script>&#34;)
        End Sel&#101;ct
    End Sub

    '显示option列表并定位,by xilou www.chinacms.org
	'textArr  : 文本数组
    'valueArr : 值数组
    'curValue : 当前选定值
	Function ShowOpList(textArr, valueArr, curValue)
	    Dim str, style, i
		style = &#34;style=&#34;&#34;background-color:#FFCCCC&#34;&#34;&#34;
		str   = &#34;&#34;
		If IsNull(curValue) Then curValue = &#34;&#34;
		For I = LBound(textArr) To UBound(valueArr)
			If Cstr(valueArr(I)) = Cstr(curValue) Then
				str = str&amp;&#34;<option value=&#34;&#34;&#34;&amp;valueArr(I)&amp;&#34;&#34;&#34; sel&#101;cted=&#34;&#34;sel&#101;cted&#34;&#34; &#34;&amp;style&amp;&#34; >&#34;&amp;textArr(I)&amp;&#34;</option>&#34;&amp;vbcrlf
			Else
				str = str&amp;&#34;<option value=&#34;&#34;&#34;&amp;valueArr(I)&amp;&#34;&#34;&#34; >&#34;&amp;textArr(I)&amp;&#34;</option>&#34;&amp;vbcrlf
			End If
		Next
		ShowOpList = str
	End Function

	'多选列表
    '注意:要使用到InArray()函数
    'textArr  : 文本数组
    'valueArr : 值数组
    'curValue : 当前选定值数组
	Function ShowMultiOpList(textArr,valueArr,curValueArr)
		Dim style, str, isCurr, I
		style = &#34;style=&#34;&#34;background-color:#FFCCCC&#34;&#34;&#34;
		str   = &#34;&#34; : isCurr = False
		If IsNull(curValue) Then curValue = &#34;&#34;
		For I = LBound(textArr) To UBound(valueArr)
			If InArray(curValueArr, valueArr(I)) Then
				str = str&amp;&#34;<option value=&#34;&#34;&#34;&amp;valueArr(I)&amp;&#34;&#34;&#34; sel&#101;cted=&#34;&#34;sel&#101;cted&#34;&#34; &#34;&amp;style&amp;&#34; >&#34;&amp;textArr(I)&amp;&#34;</option>&#34;&amp;vbcrlf
			Else
				str = str&amp;&#34;<option value=&#34;&#34;&#34;&amp;valueArr(I)&amp;&#34;&#34;&#34; >&#34;&amp;textArr(I)&amp;&#34;</option>&#34;&amp;vbcrlf
			End If
		Next
		ShowMultiOpList = str
	End Function
    '--------------------------------其他操作结束
%>
</TEXTAREA><br/><INPUT onclick="runEx('temp45925')"  type="button" value="运行此代码"/> <INPUT onclick="doCopy('temp45925')"  type="button" value="复制此代码"/><br/> [Ctrl+A 全部选择 提示：你可先修改部分代码，再按运行]</div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=231</link>
			<title><![CDATA[最简单的(div)浮动层,兼容IE6,IE7,FF2.0;]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Thu,30 Oct 2008 10:17:36 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=231</guid>	
		<description><![CDATA[最简单的浮动层,兼容IE6,IE7,FF2.0;没有加js来控制层的展现和隐藏<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/html.gif" style="margin:0px 2px -3px 0px"> HTML代码</div><div class="UBBContent"><TEXTAREA rows="8" id="temp25176">
<!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&#34;>
<html xmlns=&#34;<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>&#34;>
<head>
 <meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; />
 <meta http-equiv=&#34;Content-Language&#34; content=&#34;zh-CN&#34; />
 <meta name=&#34;Keywords&#34; content=&#34;div浮动,div浮动层,兼容div浮动&#34; />
 <meta name=&#34;Description&#34; content=&#34;by 西楼冷月,www.chinacms.org&#34; />
 <title>div浮动,div浮动层,兼容div浮动-www.chinacms.org</title>
 <style type=&#34;text/css&#34;>
 body{font-family:arial;font-size:12px;}
 .nav{width:500px;height:25px;line-height:25px;background-color:#D0E8FF;border:solid 1px #000099;}
 .nav a{display:block;}/*这个display:block;一定要加，因为a不是块元素*/

 /*浮动块要用position:absolute;定义,使用left:auto;或margin-left:-1px;定位*/
 .nav .f{position:absolute;left:auto;border:solid 1px #000099;}

 /*使用margin-left:-1px;是因为.nav定义了border为1px,所以要向前移1px才能对齐,chinacms.org*/
 /*
 .nav .f{position:absolute;margin-left:-1px;border:solid 1px #000099;}
 */
 </style>
</head>

<body>
	<p>最简单的浮动层,兼容IE6,IE7,FF2.0;没有加js来控制层的展现和隐藏</p>

	<div class=&#34;nav&#34;>
		<a href=&#34;#&#34;>西楼的导航</a><!--如果在a外面再包一个div,则不用再定义a为块-->
		<span class=&#34;f&#34;>这个是浮动块,www.chinacms.org</span>
	</div>

	<p> </p>
	<p>另一个浮动</p>

	<div class=&#34;nav&#34;>
		<a href=&#34;#&#34;>西楼的导航</a><!--如果在a外面再包一个div,则不用再定义a为块-->
		<!--使用margin-left:502px;margin-top:-26px;来定位浮动位置-->
		<span class=&#34;f&#34; style=&#34;margin-left:502px;margin-top:-26px;&#34;>这个是浮动块,www.chinacms.org</span>
	</div>
</body>

</html>
</TEXTAREA><br/><INPUT onclick="runEx('temp25176')"  type="button" value="运行此代码"/> <INPUT onclick="doCopy('temp25176')"  type="button" value="复制此代码"/><br/> [Ctrl+A 全部选择 提示：你可先修改部分代码，再按运行]</div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=226</link>
			<title><![CDATA[在asp中使用eval()实现更加灵活的模板标签]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Sun,19 Oct 2008 23:31:31 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=226</guid>	
		<description><![CDATA[eval在很多语言中都会存在，实现功能也是差不多。eval会将一段符合语法的文本当作代码执行。<br/>我们来看在vbscript中eval()的用法：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>&lt;%<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim scriptText,ary,val,n,i<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;&nbsp; = 100<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = &#34;变量测试&#34;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;//测试1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scriptText = &#34;array(n + 100, val, &#34;&#34;www.chinacms.org&#34;&#34;)&#34; &#39;符合vbscript语法的文本<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ary = Eval(scriptText) &#39;执行<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;输出<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write ary(0) &amp; &#34;-&#34; &amp; ary(1) &amp; &#34;-&#34; &amp; ary(2)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;输出的结果是:200-变量测试-www.chinacms.org<br/>%&gt;<br/></div></div><br/><br/>从上面的代码可得eval的用法：<br/><span style="color:Brown"><br/>1,eval()有返回值，例如当执行一个数组时会返回一个数组<br/>2,eval()里面的变量(如上面的val变量)是受外部变量的影响的，并不是单独放在一个容器里封闭执行的</span><br/><br/>再来看看模板<br/>一般我们要在html模板里面定义自己的模板标签，如下面的标签，表示读取文章的id,title字段，然后循环显示10条:<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> <br/>&lt;asp:article fields=&#34;id,title&#34; n=&#34;10&#34; titlelen=&#34;25&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&#34;newsdetail.asp?id={$id}&#34;&gt;{$title}&lt;/a&gt;&lt;/li&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br/>&lt;/asp:article&gt;<br/></div></div><br/><br/>上面的标签看起来很美好，但是要写正则把相关数据提取出来的时候就会有点烦琐，我们可以用以下来代替：<div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>&lt;article:Array(&#34;id,title&#34;,10,25)&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&#34;newsdetail.asp?id={$id}&#34;&gt;{$title}&lt;/a&gt;&lt;/li&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br/>&lt;/article&gt;<br/> </div></div><br/><br/>把Array(&#34;id,title&#34;,10,25)提取出来，直接eval()一下，就可以判断了，这样会不会简单多了？^_^<br/><br/>再来看一个：<br/>有时候标签中还要加上逻辑判断的，那就要加上If...Then这些东西了，可以这样实现：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> <br/>&lt;if:(Request.cookie(&#34;Uid&#34;)&lt;&gt;&#34;&#34;)&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt;已经登陆&lt;/span&gt;<br/>&lt;else&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt;还没登陆&lt;/span&gt;<br/>&lt;endif&gt;<br/></div></div><br/><br/>将(Request.cookie(&#34;Uid&#34;)&lt;&gt;&#34;&#34;)提取出来，eval()一下，将会返回true或false值，然后判断显示哪一部分。<br/><br/>还有很多其他的灵活运用就不一一举例了。<br/>概括起来就是：<br/><strong><span style="color:Brown">在标签中直接嵌入asp代码，然后提取这部分代码，eval()一下返回一个值，再根据这个值去处理相关数据。</span></strong><br/><br/>PS:vbscript里还有一个execute()函数，可以和eval()结合起来灵活使用。]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=225</link>
			<title><![CDATA[阿斯玛还是走了...]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[生活]]></category>
			<pubDate>Fri,17 Oct 2008 02:10:34 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=225</guid>	
		<description><![CDATA[阿斯玛在火影里是自己喜欢的一个人物,虽然早知道在这一集(300集)里会挂掉,但是现在看了,心里还是很失落,可是这个是剧情需要,没办法,很无奈,正如人生一样,有些事,有心但无力去做!!!<br/><br/><img src="http://www.chinacms.org/attachments/month_0810/3200810172911.jpg" border="0" alt=""/><br/>夕日红<br/><br/><img src="http://www.chinacms.org/attachments/month_0810/t2008101721232.jpg" border="0" alt=""/><br/>猿飞阿斯玛<br/><br/><img src="http://www.chinacms.org/attachments/month_0810/e2008101721258.jpg" border="0" alt=""/><br/>奈良鹿丸]]></description>
		</item>
		
			<item>
			<link>http://www.chinacms.org/default.asp?id=224</link>
			<title><![CDATA[vbscript 函数中实现可变参数]]></title>
			<author>ch_56@sina.com(西楼冷月)</author>
			<category><![CDATA[技术]]></category>
			<pubDate>Wed,15 Oct 2008 23:41:38 +0800</pubDate>
			<guid>http://www.chinacms.org/default.asp?id=224</guid>	
		<description><![CDATA[asp,vbscript 函数中实现可变参数,省略参数<br/><br/>vbscript 函数的参数是固定的，不能实现php中的参数省略，更不用说可以实现高级语言中的重载了。<br/>有时候写好了一个函数,当然是可以满足当前的需求的，可是到了后期，随着需求的变化，可能要<br/>在函数中增加一两个参数，但是因为在前期已经把这个函数应用到很多地方了，再想改已经是不可能的了，无奈，只好又重新写一个功能差不多的函数。<br/><br/>有没有一种方法，函数的参数可以动态增加或减少，这样就可以直接在函数内部通过不同参数值返回不同的结果?<br/>答案是肯定的，可以通过Dictionary对象来实现无限个参数的设置。<br/><br/><span style="color:Maroon"><strong>基本思路：参数是通过数组传递，在函数内部将参数数组转为dictionary对象使用，数组是一维或二维数组</strong></span>，形式如下：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>&lt;%<br/>&#160;&#160;&#160;&#160;Dim ary<br/>&#160;&#160;&#160;&#160;ary = array( array(&#34;Uid&#34;,1024) , array(&#34;UserName&#34;,&#34;xilou&#34;) ,array(&#34;QQ&#34;,&#34;39949376&#34;) )<br/>&#160;&#160;&#160;&#160;&#39;或者<br/>&#160;&#160;&#160;&#160;ary = array( &#34;Uid:1024&#34; , &#34;UserName:xilou&#34; , &#34;QQ:39949376&#34; )<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#39;将会把该数组转化为dictionary,则可以使用如下形式使用：<br/>&#160;&#160;&#160;&#160;Response.Write ht(&#34;Uid&#34;) &amp; ht(&#34;UserName&#34;) &amp; ht(&#34;QQ&#34;)<br/>%&gt;<br/></div></div><br/><br/>具体代码如下：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>&lt;%<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;将数组转化为dictionary对象存储<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;hashObj : dictionary对象<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;ary&nbsp;&nbsp;&nbsp;&nbsp; : 数组，格式必须为以下两种之一,第一种只能存储字符串值<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: array(&#34;Id:12&#34;,&#34;UserName:xilou&#34;,&#34;Sex:1&#34;)，即array(&#34;key:value&#34;,...)格式<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: array(array(&#34;Id&#34;,&#34;12&#34;),array(&#34;UserName&#34;,&#34;xilou&#34;),array(&#34;Sex&#34;,&#34;1&#34;))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;返回dictionary对象<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;www.chinacms.org<br/>&nbsp;&nbsp;&nbsp;&nbsp;Sub AryAddToHashTable(ByRef hashObj,ary)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim str,ht,i,k,v,pos<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For i = 0 To UBound(ary)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If IsArray(ary(i)) Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If IsObject(ary(i)(0)) Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write &#34;Error:AryToHashTable(ary),键值不可以是一个对象类型,&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write &#34;当前ary(&#34;&amp; i &amp;&#34;)(0)值类型为:&#34; &amp; TypeName(ary(i)(0))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.End()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If IsObject(ary(i)(1)) Then &#39;如果值是一个对象<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set hashObj(ary(i)(0)) = ary(i)(1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hashObj(ary(i)(0)) = ary(i)(1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str = ary(i) &amp; &#34;&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pos = InStr(str,&#34;:&#34;)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#39;www.chinacms.org<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If pos &lt; 1 Then<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Response.Write &#34;Error:AryToHashTable(ary),&#34;&#34;:&#34;&#34;不存在&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Response.Write &#34;,发生在:&#34; &amp; ary(i)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Response.End()<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;End If<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;If pos = 1 Then<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Response.Write &#34;Error:AryToHashTable(ary),键值不存在&#34;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Response.Write &#34;,发生在:&#34; &amp; ary(i)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Response.End()<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;End If<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k = Left(str,pos-1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v = Mid(str,pos+1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hashObj(k) = v<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next<br/>&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;将数组转化为dictionary对象存储<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;ary : 数组，格式必须为以下两种之一,第一种只能存储字符串值<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;&nbsp;&nbsp;&nbsp;&nbsp;: array(&#34;Id:12&#34;,&#34;UserName:xilou&#34;,&#34;Sex:1&#34;)，即array(&#34;key:value&#34;,...)格式<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;&nbsp;&nbsp;&nbsp;&nbsp;: array(array(&#34;Id&#34;,&#34;12&#34;),array(&#34;UserName&#34;,&#34;xilou&#34;),array(&#34;Sex&#34;,&#34;1&#34;))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#39;返回dictionary对象<br/>&nbsp;&nbsp;&nbsp;&nbsp;Function AryToHashTable(ary)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim str,ht,i,k,v,pos<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set ht = Server.Cr&#101;ateObject(&#34;Scripting.Dictionary&#34;)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ht.CompareMode = 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AryAddToHashTable ht , ary<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set AryToHashTable = ht<br/>&nbsp;&nbsp;&nbsp;&nbsp;End Function<br/>%&gt;<br/></div></div><br/><br/><br/>使用例子：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.chinacms.org/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>&lt;%<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;Dim ary,rs<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#39;定义函数,获取新闻<br/>&#160;&#160;&#160;&#160;&#39;返回recordset对象<br/>&#160;&#160;&#160;&#160;Function GetNews(param)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Dim ht<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Set ht = AryToHashTable(param) &#39;将参数数组转为dictionary对象<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#39;开始使用<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;If ht(&#34;n&#34;) = -1 Then &#39;如果参数n为-1表示不限制哪一条新闻<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;End If<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;If ht(&#34;isCheck&#34;) Then &#39;如果参数isCheck为true则选取通过审核的新闻<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;End If<br/>&#160;&#160;&#160;&#160;End Function<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#39;调用函数<br/>&#160;&#160;&#160;&#160;&#39;参数是通过数组传递，在函数内部将参数数组转为dictionary对象使用<br/>&#160;&#160;&#160;&#160;Set rs = GetNews(array(array(&#34;n&#34;,-1),array(&#34;isCheck&#34;,false))) <br/>%&gt;<br/></div></div>]]></description>
		</item>
		
</channel>
</rss>