﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-asfman-文章分类-asp(javascrpt)</title><link>http://www.cnitblog.com/asfman/category/2476.html</link><description>有些事，我们明知道是错的，也要去坚持，因为不甘心；有些人，我们明知道是爱的，也要去放弃，因为没结局；有时候，我们明知道没路了，却还在前行，因为习惯了。</description><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 13:39:44 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 13:39:44 GMT</pubDate><ttl>60</ttl><item><title>content-disposition</title><link>http://www.cnitblog.com/asfman/articles/48263.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Fri, 22 Aug 2008 11:23:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/48263.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/48263.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/48263.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/48263.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/48263.html</trackback:ping><description><![CDATA[&lt;%@ language="Javascript" %&gt;<br>&lt;%<br>&nbsp;Response.AddHeader("content-disposition","attachment; filename=因为.mp3");<br>if(Session("asfman"))<br>{<br>&nbsp;var BinaryStream = new ActiveXObject("ADODB.Stream");<br>&nbsp; BinaryStream.Type = 1;<br>&nbsp; BinaryStream.Open()<br>&nbsp; BinaryStream.LoadFromFile(Server.mappath("test.mp3"));<br>&nbsp;while(!BinaryStream.eos){<br>&nbsp; Response.BinaryWrite(BinaryStream.Read(1024*64));<br>&nbsp;}<br>BinaryStream.Close();<br>&nbsp;BinaryStream = null;<br>&nbsp; Response.End();<br>}else<br>{<br>Response.Write(Session("asfman")+"---"+(typeof Session("asfman")));<br>}<br>%&gt;<br>////、、、、、<br>&lt;%@ language="Javascript" %&gt;<br>&lt;%<br>&nbsp;//Response.buffer = true;<br>&nbsp; Response.AddHeader("content-disposition","attachment; filename=test.jpg");<br>&nbsp;var BinaryStream = new ActiveXObject("ADODB.Stream");<br>&nbsp; BinaryStream.Type = 1;<br>&nbsp; BinaryStream.Open()<br>&nbsp; BinaryStream.LoadFromFile(Server.mappath("test.jpg"));<br>&nbsp;while(!BinaryStream.eos){<br>&nbsp; Response.BinaryWrite(BinaryStream.Read(1024*64));<br>&nbsp;}<br>BinaryStream.Close();<br>&nbsp;BinaryStream = null;<br>&nbsp; Response.End();<br>%&gt;<br><br><img src ="http://www.cnitblog.com/asfman/aggbug/48263.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2008-08-22 19:23 <a href="http://www.cnitblog.com/asfman/articles/48263.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>编码的原理　　BASE64</title><link>http://www.cnitblog.com/asfman/articles/41133.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Tue, 18 Mar 2008 14:35:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/41133.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/41133.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/41133.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/41133.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/41133.html</trackback:ping><description><![CDATA[<div><span style="FONT-SIZE: 14pt"><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">BASE64</strong></span><span style="FONT-SIZE: 14pt">编码</span><span style="FONT-SIZE: 14pt">的<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">原理</strong>很简单，其方法是，将输入数据流每次取</span><span style="FONT-SIZE: 14pt">6 bit</span><span style="FONT-SIZE: 14pt">（每</span><span style="FONT-SIZE: 14pt">bit</span><span style="FONT-SIZE: 14pt">代表</span><span style="FONT-SIZE: 14pt">1</span><span style="FONT-SIZE: 14pt">位二进制），不足</span><span style="FONT-SIZE: 14pt">6bit</span><span style="FONT-SIZE: 14pt">的补</span><span style="FONT-SIZE: 14pt">0</span><span style="FONT-SIZE: 14pt">，这样，每</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">个</span><span style="FONT-SIZE: 14pt">8</span><span style="FONT-SIZE: 14pt">位字节将编码为</span><span style="FONT-SIZE: 14pt">4</span><span style="FONT-SIZE: 14pt">个</span><span style="FONT-SIZE: 14pt">6</span><span style="FONT-SIZE: 14pt">位字节（</span><span style="FONT-SIZE: 14pt">3&#215;8 &#8594; 4&#215;6</span><span style="FONT-SIZE: 14pt">）；不满</span><span style="FONT-SIZE: 14pt">4</span><span style="FONT-SIZE: 14pt">个字节的以</span><span style="FONT-SIZE: 14pt">&#8220;=&#8221;</span><span style="FONT-SIZE: 14pt">填充。其实这</span><span style="FONT-SIZE: 14pt">4</span><span style="FONT-SIZE: 14pt">个六位字节</span><span style="FONT-SIZE: 14pt">仍然是</span><span style="FONT-SIZE: 14pt">8</span><span style="FONT-SIZE: 14pt">位，只不过高两位被设置为</span><span style="FONT-SIZE: 14pt">0</span><span style="FONT-SIZE: 14pt">。当一个字节只有</span><span style="FONT-SIZE: 14pt">6</span><span style="FONT-SIZE: 14pt">位有效时，它的取值空间为</span><span style="FONT-SIZE: 14pt">0 </span><span style="FONT-SIZE: 14pt">到</span><span style="FONT-SIZE: 14pt"> 2</span><span style="FONT-SIZE: 14pt">的</span><span style="FONT-SIZE: 14pt">6</span><span style="FONT-SIZE: 14pt">次方减</span><span style="FONT-SIZE: 14pt">1 </span><span style="FONT-SIZE: 14pt">即</span><span style="FONT-SIZE: 14pt">63</span><span style="FONT-SIZE: 14pt">，也就是说被转换的</span><span style="FONT-SIZE: 14pt"><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">Base64</strong></span><span style="FONT-SIZE: 14pt">编码的每一个编码的取值空间为（</span><span style="FONT-SIZE: 14pt">0~63</span><span style="FONT-SIZE: 14pt">）。事实上，</span><span style="FONT-SIZE: 14pt">0~63</span><span style="FONT-SIZE: 14pt">之间的</span><span style="FONT-SIZE: 14pt">ASCII</span><span style="FONT-SIZE: 14pt">码有许多不可见字符，所以应该再做一个映射，映射表（码表）为</span></div>
<div><span style="FONT-SIZE: 14pt; COLOR: black">Table 1: The <strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">Base64</strong> Alphabet <br>Value Encoding Value Encoding Value Encoding Value Encoding <br>0 A 17 R 34 i 51 z <br>1 B 18 S 35 j 52 0 <br>2 C 19 T 36 k 53 1 <br>3 D 20 U 37 l 54 2 <br>4 E 21 V 38 m 55 3 <br>5 F 22 W 39 n 56 4 <br>6 G 23 X 40 o 57 5 <br>7 H 24 Y 41 p 58 6 <br>8 I 25 Z 42 q 59 7 <br>9 J 26 a 43 r 60 8 <br>10 K 27 b 44 s 61 9 <br>11 L 28 c 45 t 62 + <br>12 M 29 d 46 u 63 / <br>13 N 30 e 47 v (pad) = <br>14 O 31 f 48 w <br>15 P 32 g 49 x <br>16 Q 33 h 50 y</span></div>
<div><font size=3>&nbsp;</font><span style="FONT-SIZE: 14pt">这样就可以将</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">个</span><span style="FONT-SIZE: 14pt">8</span><span style="FONT-SIZE: 14pt">位字节，转换为</span><span style="FONT-SIZE: 14pt">4</span><span style="FONT-SIZE: 14pt">个可见字符。</span><span style="FONT-SIZE: 14pt">也就是说，转换后的字符串要比原来的长</span><span style="FONT-SIZE: 14pt">1/3</span><span style="FONT-SIZE: 14pt">，扩张率为</span><span style="FONT-SIZE: 14pt">3:4</span><span style="FONT-SIZE: 14pt">。</span><span style="FONT-SIZE: 14pt">举例说明：　　</span><span style="FONT-SIZE: 14pt">1</span><span style="FONT-SIZE: 14pt">、当字符串字符个数为</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">的倍数时；比如字符串</span><span style="FONT-SIZE: 14pt">&#8220;ABC&#8221;</span><span style="FONT-SIZE: 14pt">，其在计算机内存中的十六进制表示为</span><span style="FONT-SIZE: 14pt">$41</span><span style="FONT-SIZE: 14pt">、</span><span style="FONT-SIZE: 14pt">$42</span><span style="FONT-SIZE: 14pt">、</span><span style="FONT-SIZE: 14pt">$43</span><span style="FONT-SIZE: 14pt">，十进制表示为</span><span style="FONT-SIZE: 14pt">&#8220;65&#8221;&#8220;66&#8221;&#8220;67&#8221;</span><span style="FONT-SIZE: 14pt">；二进制表示为</span><span style="FONT-SIZE: 14pt">01000001</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">01000010</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">01000011</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">&nbsp;</span><span style="FONT-SIZE: 14pt">将这三个二进制数依次取</span><span style="FONT-SIZE: 14pt">6bit</span><span style="FONT-SIZE: 14pt">，　　</span><span style="FONT-SIZE: 14pt">010000/01</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">0100/0010</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">01/000011</span><span style="FONT-SIZE: 14pt">　　就转换成了：　　</span><span style="FONT-SIZE: 14pt">010000</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">010100</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">001001</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">000011</span><span style="FONT-SIZE: 14pt">　　将这四个二进制数转换成十六制数为：</span><span style="FONT-SIZE: 14pt">$10</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$14</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$9</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$3</span><span style="FONT-SIZE: 14pt">，十进制数位为</span><span style="FONT-SIZE: 14pt">16</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">20</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">9</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">。对照上面的码表，分别查找出对应的字符为</span><span style="FONT-SIZE: 14pt">Q</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">U</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">J</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">D</span><span style="FONT-SIZE: 14pt">。也是就说字符串</span><span style="FONT-SIZE: 14pt">&#8220;ABC&#8221;</span><span style="FONT-SIZE: 14pt">经过</span><span style="FONT-SIZE: 14pt"><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">BASE64</strong></span><span style="FONT-SIZE: 14pt">编码后得出</span><span style="FONT-SIZE: 14pt">&#8220;QUJD&#8221;</span><span style="FONT-SIZE: 14pt">。　　这是最简单的情况，即</span><span style="FONT-SIZE: 14pt">ASCII</span><span style="FONT-SIZE: 14pt">码字符数刚好可以被</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">整除。接着继续讨论余数为</span><span style="FONT-SIZE: 14pt">2</span><span style="FONT-SIZE: 14pt">、为</span><span style="FONT-SIZE: 14pt">1</span><span style="FONT-SIZE: 14pt">的情况。　　</span><span style="FONT-SIZE: 14pt">2</span><span style="FONT-SIZE: 14pt">、当余数为</span><span style="FONT-SIZE: 14pt">2</span><span style="FONT-SIZE: 14pt">时，比如字符串</span><span style="FONT-SIZE: 14pt">&#8220;ce&#8221;</span><span style="FONT-SIZE: 14pt">，其在内存中十六进制表示为</span><span style="FONT-SIZE: 14pt">$63</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$65</span><span style="FONT-SIZE: 14pt">；十进制表示表示</span><span style="FONT-SIZE: 14pt">99</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">101</span><span style="FONT-SIZE: 14pt">；二进制表示为　　</span><span style="FONT-SIZE: 14pt">01100011</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">01100101</span><span style="FONT-SIZE: 14pt">　依次取</span><span style="FONT-SIZE: 14pt">6bit</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">011000/11</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">0110/0101</span><span style="FONT-SIZE: 14pt">　　这时，第</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">个字符不足</span><span style="FONT-SIZE: 14pt">6</span><span style="FONT-SIZE: 14pt">位，在后面补零，也就是</span><span style="FONT-SIZE: 14pt">0101</span><span style="FONT-SIZE: 14pt">变成</span><span style="FONT-SIZE: 14pt">010100</span><span style="FONT-SIZE: 14pt">。转换结果为　　</span><span style="FONT-SIZE: 14pt">011000</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">110110</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">010100</span><span style="FONT-SIZE: 14pt">　　这</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">个二进制数转换成十六制数为</span><span style="FONT-SIZE: 14pt">$18</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$36</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$14</span><span style="FONT-SIZE: 14pt">；十进制数位为</span><span style="FONT-SIZE: 14pt">24</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">54</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">20</span><span style="FONT-SIZE: 14pt">。对照码表得出结果</span><span style="FONT-SIZE: 14pt">&#8220;Y2U&#8221;</span><span style="FONT-SIZE: 14pt">。编码后的字符个数不足</span><span style="FONT-SIZE: 14pt">4</span><span style="FONT-SIZE: 14pt">位，用</span><span style="FONT-SIZE: 14pt">&#8220;</span><span style="FONT-SIZE: 14pt">＝</span><span style="FONT-SIZE: 14pt">&#8221;</span><span style="FONT-SIZE: 14pt">填充，最后编码得出</span><span style="FONT-SIZE: 14pt">&#8220;Y2U=&#8221;</span><span style="FONT-SIZE: 14pt">。　　</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">、当余数为</span><span style="FONT-SIZE: 14pt">1</span><span style="FONT-SIZE: 14pt">时，比如字符串</span><span style="FONT-SIZE: 14pt">&#8220;{&#8221;</span><span style="FONT-SIZE: 14pt">，其在内存中的十六进制表示为</span><span style="FONT-SIZE: 14pt">$7B</span><span style="FONT-SIZE: 14pt">，十进制为</span><span style="FONT-SIZE: 14pt">123</span><span style="FONT-SIZE: 14pt">，二进制位表示为　　</span><span style="FONT-SIZE: 14pt">01111011</span><span style="FONT-SIZE: 14pt">　依次取</span><span style="FONT-SIZE: 14pt">6bit</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">011110/11</span><span style="FONT-SIZE: 14pt">　　　补</span><span style="FONT-SIZE: 14pt">0</span><span style="FONT-SIZE: 14pt">后为　</span><span style="FONT-SIZE: 14pt">011110/110000</span><span style="FONT-SIZE: 14pt">　　转换结果为</span><span style="FONT-SIZE: 14pt">011110</span><span style="FONT-SIZE: 14pt">和</span><span style="FONT-SIZE: 14pt">110000</span><span style="FONT-SIZE: 14pt">　　这两个二进制数转换成十六进制数为</span><span style="FONT-SIZE: 14pt">$1E</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">$30</span><span style="FONT-SIZE: 14pt">，十进制数为</span><span style="FONT-SIZE: 14pt">30</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">48</span><span style="FONT-SIZE: 14pt">。对照码表得出结果为</span><span style="FONT-SIZE: 14pt">&#8220;ew&#8221;</span><span style="FONT-SIZE: 14pt">，补上</span><span style="FONT-SIZE: 14pt">&#8220;</span><span style="FONT-SIZE: 14pt">＝</span><span style="FONT-SIZE: 14pt">&#8221;</span><span style="FONT-SIZE: 14pt">，最后编码得出</span><span style="FONT-SIZE: 14pt">&#8220;ew= =&#8221;</span><span style="FONT-SIZE: 14pt">。　　解码也很简单，是编码的逆过程，即将每个字符对照码表换算成</span><span style="FONT-SIZE: 14pt">6bit</span><span style="FONT-SIZE: 14pt">的二进制数，然后重组起来，按</span><span style="FONT-SIZE: 14pt">8</span><span style="FONT-SIZE: 14pt">位进行截取，得出原码。</span></div>
<div><span style="FONT-SIZE: 14pt">二、</span><span style="FONT-SIZE: 14pt"><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">BASE64</strong></span><span style="FONT-SIZE: 14pt">编码的实现方法　　</span><span style="FONT-SIZE: 14pt"><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">BASE64</strong></span><span style="FONT-SIZE: 14pt">编码的实现方法很多，但大多基于二进制数的移位、与或操作，不便于理解。为此，本人经过摸索，想出了一种基于十进制下的易于掌握的编码方法。根据上述<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">原理</strong>，每</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">个字节将转换成４个字节，也就是说每一个半字节（</span><span style="FONT-SIZE: 14pt">12bit</span><span style="FONT-SIZE: 14pt">）正好转换成</span><span style="FONT-SIZE: 14pt">2</span><span style="FONT-SIZE: 14pt">个编码后的字符（２</span><span style="FONT-SIZE: 14pt">&#215;6bit</span><span style="FONT-SIZE: 14pt">）。在十六进制下半个字节可用</span><span style="FONT-SIZE: 14pt">0~F</span><span style="FONT-SIZE: 14pt">表示。为此，依次取字符串在十六进制表示下的三位，通过整除和取余运算很容易得出编码后的</span><span style="FONT-SIZE: 14pt">2</span><span style="FONT-SIZE: 14pt">个字符。　　比如字符串</span><span style="FONT-SIZE: 14pt">ABC</span><span style="FONT-SIZE: 14pt">，其十六进制在内存中表示</span><span style="FONT-SIZE: 14pt">$414243</span><span style="FONT-SIZE: 14pt">，依次取</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">位，得出结果为</span><span style="FONT-SIZE: 14pt">$414</span><span style="FONT-SIZE: 14pt">和</span><span style="FONT-SIZE: 14pt">$243</span><span style="FONT-SIZE: 14pt">，转换成十进制为</span><span style="FONT-SIZE: 14pt">1044</span><span style="FONT-SIZE: 14pt">和</span><span style="FONT-SIZE: 14pt">579</span><span style="FONT-SIZE: 14pt">。将这两个数分别与</span><span style="FONT-SIZE: 14pt">64</span><span style="FONT-SIZE: 14pt">进行整除和取余运算　　</span><span style="FONT-SIZE: 14pt">1044</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">Div</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">64=16</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt">1044</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">Mod</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">64=20&nbsp;</span><span style="FONT-SIZE: 14pt">　　</span><span style="FONT-SIZE: 14pt"> 579</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">Div</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">64=9</span><span style="FONT-SIZE: 14pt">　　　</span><span style="FONT-SIZE: 14pt">579</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">Mod</span><span style="FONT-SIZE: 14pt">　</span><span style="FONT-SIZE: 14pt">64=3</span><span style="FONT-SIZE: 14pt">　　得出结果为</span><span style="FONT-SIZE: 14pt">16</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">20</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">9</span><span style="FONT-SIZE: 14pt">，</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">。对照上面的码表，编码结果同样为</span><span style="FONT-SIZE: 14pt">&#8220;QUJD&#8221;</span><span style="FONT-SIZE: 14pt">。　　在高级语言中，很容易将字符串的十六进制以字符串形式表达出来，然后通过依次截取</span><span style="FONT-SIZE: 14pt">3</span><span style="FONT-SIZE: 14pt">个字符转换成整数，最后进行上述运算得出结果。</span></div>
<br>
<img src ="http://www.cnitblog.com/asfman/aggbug/41133.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2008-03-18 22:35 <a href="http://www.cnitblog.com/asfman/articles/41133.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>404 and execute,transfer</title><link>http://www.cnitblog.com/asfman/articles/41091.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Tue, 18 Mar 2008 05:42:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/41091.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/41091.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/41091.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/41091.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/41091.html</trackback:ping><description><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 假如我输入<a href="http://localhost/add.htm">http://localhost/add.htm</a> 这个页面不存在，那么转向404自定义页面处理，处理页面通过query_string获到的内容为：404;http://localhost/add.htm 然后可以通过分析这个字符串就行转向处理，通过Execute,transfer的asp都可以通过query_string来获得<br>这个字符串。<br>&nbsp;&nbsp;&nbsp; Execute,Transfer转向的页面不能传递、获取主页面的变量。<br>&nbsp;&nbsp;&nbsp; Eexucute执行转向那个页面，执行完后返回所有内容回主页面，然后主页面接着处理。<br>&nbsp;&nbsp;&nbsp; Transfer执行转向那个页面，执行完后返回所有内容回主页面，然后主页面停止处理后面代码。</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/41091.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2008-03-18 13:42 <a href="http://www.cnitblog.com/asfman/articles/41091.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于mdb里的乱码</title><link>http://www.cnitblog.com/asfman/articles/37801.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 17 Dec 2007 11:30:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/37801.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/37801.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/37801.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/37801.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/37801.html</trackback:ping><description><![CDATA[<p>只要mdb字段打开是正常字符，那么无论用什么编码读取都会正常，除非codepage设置与meta，和charset</p>
设置不一置 。<br>乱码情况：<br>当一个页面以utf8显示，发送字符到后台asp文件，而后台asp文件是gb2312编码，这时读取到的字符为乱码，存入数据库，数据库显示也乱码。<br>当我们设置读取页面的codepage为gb2312，然后设置meta和charset为utf-8会显示正常
<img src ="http://www.cnitblog.com/asfman/aggbug/37801.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-12-17 19:30 <a href="http://www.cnitblog.com/asfman/articles/37801.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>向游览器输出excel</title><link>http://www.cnitblog.com/asfman/articles/36393.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Sat, 17 Nov 2007 00:54:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/36393.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/36393.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/36393.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/36393.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/36393.html</trackback:ping><description><![CDATA[以下步骤说明了如何使用此方法向浏览器写入一个 Excel 文件：
<table class="list ol">
    <tbody>
        <tr>
            <td class=number>1.</td>
            <td class=text>创建一个新的 ASP 页并粘贴以下代码：<code>
            <pre class=code>&lt;%
            'Set the content type to the specific type that you are sending.
            Response.ContentType = "application/x-msexcel"
            Const adTypeBinary = 1
            Dim strFilePath
            strFilePath = "C:\ExcelFiles\Excel1.xls" 'This is the path to the file on disk.
            Set objStream = Server.CreateObject("ADODB.Stream")
            objStream.Open
            objStream.Type = adTypeBinary
            objStream.LoadFromFile strFilePath
            Response.BinaryWrite objStream.Read
            objStream.Close
            Set objStream = Nothing
            %&gt;
            </pre>
            </code></td>
        </tr>
        <tr>
            <td class=number>2.</td>
            <td class=text>将该文件保存到 Web 服务器。</td>
        </tr>
        <tr>
            <td class=number>3.</td>
            <td class=text>在浏览器中，浏览到该文件。</td>
        </tr>
    </tbody>
</table>
<img src ="http://www.cnitblog.com/asfman/aggbug/36393.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-17 08:54 <a href="http://www.cnitblog.com/asfman/articles/36393.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>about stream read bytes</title><link>http://www.cnitblog.com/asfman/articles/36392.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Fri, 16 Nov 2007 16:17:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/36392.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/36392.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/36392.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/36392.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/36392.html</trackback:ping><description><![CDATA[&nbsp;stream&nbsp;object only can&nbsp;write original bytes data,using midb intercepts bytes data cannot use<br>eg:<br>pData = Midb(sData,1,100)<br>pData cannot use width Stream' Write method
<img src ="http://www.cnitblog.com/asfman/aggbug/36392.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-17 00:17 <a href="http://www.cnitblog.com/asfman/articles/36392.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>创建数据库表组件</title><link>http://www.cnitblog.com/asfman/articles/36275.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Wed, 14 Nov 2007 08:44:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/36275.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/36275.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/36275.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/36275.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/36275.html</trackback:ping><description><![CDATA[&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;component&gt;<br>&nbsp; &lt;registration progid="asfman.createTable" classid="{11223344-aabb-ccdd-eeff-012345678901}" description="创建数据库表" version="1"&gt;<br>&nbsp; &lt;script language="VBScript"&gt;<br>&nbsp; &lt;![CDATA[<br>&nbsp;&nbsp;&nbsp;&nbsp; Function Register<br>&nbsp;&nbsp;&nbsp; MsgBox "数据库表组件注册成功！",0,"注册信息"<br>&nbsp;&nbsp;End Function<br>&nbsp;&nbsp;Function UnRegister<br>&nbsp;&nbsp;&nbsp; MsgBox "数据库表组件卸载成功！",0,"卸载信息"<br>&nbsp;&nbsp;End Function<br>&nbsp;&nbsp;]]&gt;<br>&nbsp; &lt;/script&gt;<br>&nbsp; &lt;/registration&gt;<br>&nbsp;&lt;public&gt;<br>&nbsp;&nbsp;&nbsp; &lt;property name="Name" dispid="0" description="组件名称"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;get internalName="componentName" /&gt;<br>&nbsp;&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp; &lt;method name="createTable"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;parameter name="connStr" description="数据库名字" /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;parameter name="tName" description="表名" /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;parameter name="config" description="一个对象包含字段名字和类型" /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;parameter name="bFlag" description="boolean值,true为创建新的数据库，默认数据库已经存在" /&gt;<br>&nbsp;&lt;/method&gt;<br>&nbsp;&lt;/public&gt;<br>&lt;implements type="ASP"/&gt;<br>&lt;script language="Javascript"&gt;<br>&lt;![CDATA[<br>function componentName()<br>{<br>&nbsp;return "数据库表组件！"<br>}<br>var ColumnType = {<br>&nbsp;"SmallInt" : 2,&nbsp;&nbsp;// 整型<br>&nbsp;"Int" : 3,&nbsp;&nbsp;&nbsp;// 长整型<br>&nbsp;"Real" : 4,&nbsp;&nbsp;&nbsp;// 单精度型<br>&nbsp;"Float" : 5,&nbsp;&nbsp;// 双精度型<br>&nbsp;"Money" : 6,&nbsp;&nbsp;// 货币<br>&nbsp;"DateTime" : 7,&nbsp;&nbsp;// 日期时间<br>&nbsp;"Bit" : 11,&nbsp;&nbsp;&nbsp;// 是否<br>&nbsp;"TimeStamp" : 13,<br>&nbsp;"TinyInt" : 17,&nbsp;&nbsp;// 字节<br>&nbsp;"UniqueIdentifier" : 72,&nbsp;// 同步复制 ID<br>&nbsp;"Binary" : 128,<br>&nbsp;"Char" : 129,<br>&nbsp;"NChar" : 130,<br>&nbsp;"Decimal" : 131,&nbsp;&nbsp;// 小数<br>&nbsp;"Date" : 133,<br>&nbsp;"SmallDateTime" : 135,<br>&nbsp;"VarChar" : 202,&nbsp;&nbsp;// 文本<br>&nbsp;"Text" : 203,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //备注(200 sql varchar 201 sql text)<br>&nbsp;"Binary" : 204,&nbsp;&nbsp;&nbsp;// 二进制数据<br>&nbsp;"Image" : 205&nbsp;&nbsp;&nbsp;// OLE 对象<br>}<br>function enumDataType(strType)<br>{<br>&nbsp;strType = strType.toLowerCase();<br>&nbsp;for(var x in ColumnType)<br>&nbsp;{<br>&nbsp;&nbsp;if(x.toLowerCase() == strType) return ColumnType[x];<br>&nbsp;}<br>&nbsp;&nbsp;return 128;<br>}<br>function createTable(connStr,tName,config,bFlag)<br>{<br>&nbsp;var oCatalog = new ActiveXObject("AdoX.Catalog");<br>&nbsp;bFlag ? oCatalog.Create("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + connStr) : (oCatalog.ActiveConnection="Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + connStr);<br>&nbsp;var oTable = new ActiveXObject("AdoX.Table");<br>&nbsp;oTable.Name = tName;<br>&nbsp;oTable.ParentCatalog = oCatalog;<br>&nbsp;oTable.Columns.Append("id",3);<br>&nbsp;oTable.Columns("id").Properties("AutoIncrement") = true;&nbsp;<br>&nbsp;for(var i in config)<br>&nbsp;{<br>&nbsp;&nbsp;if(config.hasOwnProperty(i))<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;oTable.Columns.Append(i,enumDataType(config[i]));<br>&nbsp;&nbsp;}<br>&nbsp;}<br>&nbsp;&nbsp;&nbsp; oCatalog.Tables.Append(oTable);<br>&nbsp;oCatalog.ActiveConnection.Close();<br>&nbsp;oCatalog = null;<br>}<br>]]&gt;<br>&lt;/script&gt;<br>&lt;comment&gt;<br>示例：createTable("fk.mdb","fk3",{name:"varchar",value:"Text"},false);<br>&lt;/comment&gt;<br>&lt;/component&gt;
<img src ="http://www.cnitblog.com/asfman/aggbug/36275.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-14 16:44 <a href="http://www.cnitblog.com/asfman/articles/36275.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>http headers reference</title><link>http://www.cnitblog.com/asfman/articles/36218.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Tue, 13 Nov 2007 01:45:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/36218.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/36218.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/36218.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/36218.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/36218.html</trackback:ping><description><![CDATA[<div class=topic>
<div class=majorTitle>Application&nbsp;Center&nbsp;Test</div>
<div class=title>HTTP Headers Reference</div>
<!--content type: PSDK_8. Transform: everett2mtps.xslt.-->
<div id=nstext valign="bottom">
<p>Both HTTP requests and HTTP responses use headers to send information about the HTTP message. A header is a series of lines, with each line containing a name followed by a colon and a space, and then a value. The fields can be arranged in any order. Some header fields are used in both request and response headers, while others are appropriate only for either a request or a response. </p>
<p>Many request header fields will allow the client to specify several acceptable options in the value part and, in some cases, even rank each option's preference. Multiple items are separated using a comma. For example, a client could send a request header that includes "Content-Encoding: gzip, compress," indicating it would accept either type of compression. If the server uses gzip encoding for the response body, its response header would include "Content-Encoding: gzip".</p>
<p>Some fields can occur more than once in a single header. For example, a header can have multiple "Warning" fields.</p>
<p>The following tables list HTTP 1.1 header fields. Note that some header fields are MIME fields. MIME fields are defined in the Internet Engineering Task Force (IETF) document RFC 2045, but they are also used by the HTTP 1.1 protocol. See the IETF page for more information about the MIME and HTTP 1.1 specifications.</p>
<a name=general_headers>
<h2 class=dtH2>General Header Fields</h2>
</a>
<p>General header fields can be used in request messages and response messages.</p>
<div class=tablediv>
<table class=dtTABLE>
    <tbody>
        <tr vAlign=top>
            <th>Name</th>
            <th>Example Value</th>
        </tr>
        <tr vAlign=top>
            <td>Cache-Control</td>
            <td>"max-age=10"</td>
        </tr>
        <tr vAlign=top>
            <td>Connection</td>
            <td>"close"</td>
        </tr>
        <tr vAlign=top>
            <td>Date</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
        <tr vAlign=top>
            <td>Pragma</td>
            <td>"no-cache"</td>
        </tr>
        <tr vAlign=top>
            <td>Trailer</td>
            <td>"Date"</td>
        </tr>
        <tr vAlign=top>
            <td>Transfer-Encoding</td>
            <td>"chunked"</td>
        </tr>
        <tr vAlign=top>
            <td>Upgrade</td>
            <td>"SHTTP/1.3"</td>
        </tr>
        <tr vAlign=top>
            <td>Via</td>
            <td>"HTTP/1.1 Proxy1, HTTP/1.1 Proxy2"</td>
        </tr>
        <tr vAlign=top>
            <td>Warning</td>
            <td>"112 Disconnected Operation"</td>
        </tr>
    </tbody>
</table>
</div>
<a name=request_headers>
<h2 class=dtH2>Request Header Fields </h2>
</a>
<p>Request header fields are used in request messages only.</p>
<div class=tablediv>
<table class=dtTABLE>
    <tbody>
        <tr vAlign=top>
            <th>Name</th>
            <th>Example Value</th>
        </tr>
        <tr vAlign=top>
            <td>Accept</td>
            <td>"text/html, image/*"</td>
        </tr>
        <tr vAlign=top>
            <td>Accept-Charset</td>
            <td>"iso8859-5"</td>
        </tr>
        <tr vAlign=top>
            <td>Accept-Encoding</td>
            <td>"gzip, compress"</td>
        </tr>
        <tr vAlign=top>
            <td>Accept-Language</td>
            <td>"en, fr"</td>
        </tr>
        <tr vAlign=top>
            <td>Authorization</td>
            <td>[credentials]</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Encoding </td>
            <td>"gzip"</td>
        </tr>
        <tr vAlign=top>
            <td>Expect</td>
            <td>"100-continue"</td>
        </tr>
        <tr vAlign=top>
            <td>From</td>
            <td>"user@microsoft.com"</td>
        </tr>
        <tr vAlign=top>
            <td>Host</td>
            <td>"www.microsoft.com"</td>
        </tr>
        <tr vAlign=top>
            <td>If-Match</td>
            <td>"entity_tag001"</td>
        </tr>
        <tr vAlign=top>
            <td>If-Modified-Since</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
        <tr vAlign=top>
            <td>If-None-Match</td>
            <td>"entity_tag001"</td>
        </tr>
        <tr vAlign=top>
            <td>If-Range</td>
            <td>"entity_tag001" or "Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
        <tr vAlign=top>
            <td>If-Unmodified-Since</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
        <tr vAlign=top>
            <td>Max-Forwards</td>
            <td>"3"</td>
        </tr>
        <tr vAlign=top>
            <td>Proxy-Authorization</td>
            <td>[credentials]</td>
        </tr>
        <tr vAlign=top>
            <td>Range</td>
            <td>"bytes=100-599"</td>
        </tr>
        <tr vAlign=top>
            <td>Referer</td>
            <td>"http://www.microsoft.com/resources.asp"</td>
        </tr>
        <tr vAlign=top>
            <td>TE</td>
            <td>"trailers"</td>
        </tr>
        <tr vAlign=top>
            <td>User-Agent</td>
            <td>"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"</td>
        </tr>
    </tbody>
</table>
</div>
<a name=response_headers>
<h2 class=dtH2>Response Header Fields </h2>
</a>
<p>Response header fields are used in response messages only.</p>
<div class=tablediv>
<table class=dtTABLE>
    <tbody>
        <tr vAlign=top>
            <th>Name</th>
            <th>Example Value</th>
        </tr>
        <tr vAlign=top>
            <td>Accept-Ranges</td>
            <td>"none"</td>
        </tr>
        <tr vAlign=top>
            <td>Age</td>
            <td>"2147483648(2^31)"</td>
        </tr>
        <tr vAlign=top>
            <td>ETag</td>
            <td>"b38b9-17dd-367c5dcd"</td>
        </tr>
        <tr vAlign=top>
            <td>Last-Modified</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
        <tr vAlign=top>
            <td>Location</td>
            <td>"http://localhost/redirecttarget.asp"</td>
        </tr>
        <tr vAlign=top>
            <td>Proxy-Authenticate</td>
            <td>[challenge]</td>
        </tr>
        <tr vAlign=top>
            <td>Retry-After</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT" or "60"</td>
        </tr>
        <tr vAlign=top>
            <td>Server</td>
            <td>"Microsoft-IIS/5.0"</td>
        </tr>
        <tr vAlign=top>
            <td>Vary</td>
            <td>"Date"</td>
        </tr>
        <tr vAlign=top>
            <td>WWW-Authenticate</td>
            <td>[challenge]</td>
        </tr>
    </tbody>
</table>
</div>
<a name=response_headers>
<h2 class=dtH2>Entity Header Fields </h2>
</a>
<p>Entity header fields can be used in request messages or response messages. Entity header fields contain information about the entity-body of the message, such as the encoding format used.</p>
<div class=tablediv>
<table class=dtTABLE>
    <tbody>
        <tr vAlign=top>
            <th>Name</th>
            <th>Example Value</th>
        </tr>
        <tr vAlign=top>
            <td>Allow</td>
            <td>"GET, HEAD"</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Encoding</td>
            <td>"gzip"</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Language</td>
            <td>"en"</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Length</td>
            <td>"8445"</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Location</td>
            <td>"http://localhost/page.asp"</td>
        </tr>
        <tr vAlign=top>
            <td>Content-MD5</td>
            <td>[md5-digest]</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Range</td>
            <td>"bytes 2543-4532/7898"</td>
        </tr>
        <tr vAlign=top>
            <td>Content-Type</td>
            <td>"text/html"</td>
        </tr>
        <tr vAlign=top>
            <td>Expires</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
        <tr vAlign=top>
            <td>Last-Modified</td>
            <td>"Tue, 11 Jul 2000 18:23:51 GMT"</td>
        </tr>
    </tbody>
</table>
</div>
<a name=request_example>
<h2 class=dtH2>Request Header Example</h2>
</a>
<p>The following is a simple example of an HTTP request.</p>
<div class=code id=ctl00_LibFrame_ctl02_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl02');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl02 space="preserve">GET /articles/news/today.asp HTTP/1.1</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl03_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl03');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl03 space="preserve">Accept: */*</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl04_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl04');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl04 space="preserve">Accept-Language: en-us</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl05_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl05');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl05 space="preserve">Connection: Keep-Alive</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl06_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl06');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl06 space="preserve">Host: localhost</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl07_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl07');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl07 space="preserve">Referer: http://localhost/links.asp</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl08_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl08');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl08 space="preserve">User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl09_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl09');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl09 space="preserve">Accept-Encoding: gzip, deflate</pre>
</div>
<p>This request has a request-line, which includes the method (GET), the resource path (/articles/news/today.asp) and the HTTP version (HTTP/1.1). Everything after the request-line is part of the header, since this request does not have a body. Following the header is an empty line, which marks the end of the headers.</p>
<a name=response_example>
<h2 class=dtH2>Response Header Example</h2>
</a>
<p>The Web server could respond to the previous request in a number of ways. Assuming the file was accessible and the user had rights to view it, the response would be similar to the following:</p>
<div class=code id=ctl00_LibFrame_ctl10_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl10');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl10 space="preserve">HTTP/1.1 200 OK</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl11_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl11');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl11 space="preserve">Server: Microsoft-IIS/5.0</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl12_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl12');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl12 space="preserve">Date: Thu, 13 Jul 2000 05:46:53 GMT</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl13_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl13');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl13 space="preserve">Content-Length: 2291</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl14_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl14');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl14 space="preserve">Content-Type: text/html</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl15_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl15');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl15 space="preserve">Set-Cookie: ASPSESSIONIDQQGGGNCG=LKLDFFKCINFLDMFHCBCBMFLJ; path=/</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl16_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl16');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl16 space="preserve">Cache-control: private</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl17_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl17');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl17 space="preserve"></pre>
</div>
<div class=code id=ctl00_LibFrame_ctl18_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl18');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl18 space="preserve">&lt;HTML&gt;</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl19_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl19');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl19 space="preserve">&lt;BODY&gt;</pre>
</div>
<div class=code id=ctl00_LibFrame_ctl20_>
<div class=CodeSnippetTitleBar>
<div class=CodeDisplayLanguage></div>
<div class=CopyCodeButton><a class=copyCode href="javascript:CopyCode('ctl00_LibFrame_ctl20');"><img height=9 src="http://msdn2.microsoft.com/msdn/Controls/CodeSnippet/en-us/copy_off.gif" align=middle border=0> Copy Code</a></div>
</div>
<pre class=code id=ctl00_LibFrame_ctl20 space="preserve">...</pre>
</div>
<p>The first line of the response is called the status-line. It contains the HTTP version used for the response, the status code (200), and the reason phrase. There is a header, with five fields in this example, followed by an empty line (a carriage return and line feed) and then the first two lines of the response body.</p>
<h4 class=dtH4>See Also</h4>
<p><a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl21',this);" href="http://msdn2.microsoft.com/en-us/library/aa287838(VS.71).aspx">Request.Headers property</a> | <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl22',this);" href="http://msdn2.microsoft.com/en-us/library/aa287837(VS.71).aspx">Response.Headers property</a> | <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl23',this);" href="http://msdn2.microsoft.com/en-us/library/aa287672(VS.71).aspx">Headers object</a> | <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl24',this);" href="http://msdn2.microsoft.com/en-us/library/aa287670(VS.71).aspx">Header object</a> | <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl25',this);" href="http://www.ietf.org/">Internet Engineering Task Force main page</a></p>
</div>
</div>
<img src ="http://www.cnitblog.com/asfman/aggbug/36218.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-13 09:45 <a href="http://www.cnitblog.com/asfman/articles/36218.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>http response headers </title><link>http://www.cnitblog.com/asfman/articles/36217.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Tue, 13 Nov 2007 01:35:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/36217.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/36217.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/36217.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/36217.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/36217.html</trackback:ping><description><![CDATA[<div class=title xmlns:msxsl="urn:schemas-microsoft-com:xslt">HTTP Response Headers</div>
<!--content type: SDKML. Transform: wc2mtps.xslt.-->
<div class=clsDocBody>
<p>The following list contains valid HTTP response headers. Use these headers to provide information about your HTML document in a <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl02',this);" href="http://msdn2.microsoft.com/en-us/library/ms535853.aspx"><u><font color=#0000ff>meta</font></u></a> tag, or to gather information about another document using <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl03',this);" href="http://msdn2.microsoft.com/en-us/library/aa384238.aspx"><u><font color=#0000ff>HttpQueryInfo</font></u></a> and <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl04',this);" href="http://msdn2.microsoft.com/en-us/library/ms774972.aspx"><u><font color=#0000ff>QueryInfo</font></u></a>.</p>
<p class=clsRef>Constants</p>
<blockquote>
<dl class=clsRef>
<dt><strong><a name=ACCEPT><strong>ACCEPT</strong></a></strong>&nbsp;(24)
<dd>Acceptable media types.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ACCEPT-CHARSET><strong>ACCEPT-CHARSET</strong></a></strong>&nbsp;(25)
<dd>Acceptable character sets.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ACCEPT-ENCODING><strong>ACCEPT-ENCODING</strong></a></strong>&nbsp;(26)
<dd>Acceptable content-coding values.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ACCEPT-LANGUAGE><strong>ACCEPT-LANGUAGE</strong></a></strong>&nbsp;(27)
<dd>Acceptable natural languages.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ACCEPT-RANGES><strong>ACCEPT-RANGES</strong></a></strong>&nbsp;(42)
<dd>Types of range requests that are accepted.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=AGE><strong>AGE</strong></a></strong>&nbsp;(48)
<dd>An estimate of the amount of time since the response was generated at the origin server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ALLOW><strong>ALLOW</strong></a></strong>&nbsp;(7)
<dd>Methods supported by the server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=AUTHORIZATION><strong>AUTHORIZATION</strong></a></strong>&nbsp;(28)
<dd>Authorization credentials used for a request.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CACHE-CONTROL><strong>CACHE-CONTROL</strong></a></strong>&nbsp;(49)
<dd>Cache control directives.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONNECTION><strong>CONNECTION</strong></a></strong>&nbsp;(23)
<dd>Options that are specified for a particular connection and must not be communicated by proxies over further connections.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-BASE><strong>CONTENT-BASE</strong></a></strong>&nbsp;(50)
<dd>Base Uniform Resource Identifier (URI) for resolving relative URLs within the entity.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-DESCRIPTION><strong>CONTENT-DESCRIPTION</strong></a></strong>&nbsp;(4)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-DISPOSITION><strong>CONTENT-DISPOSITION</strong></a></strong>&nbsp;(47)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-ENCODING><strong>CONTENT-ENCODING</strong></a></strong>&nbsp;(29)
<dd>Any additional content codings that have been applied to the entire resource.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-ID><strong>CONTENT-ID</strong></a></strong>&nbsp;(3)
<dd>Content identification.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-LANGUAGE><strong>CONTENT-LANGUAGE</strong></a></strong>&nbsp;(6)
<dd>Language in which the content is presented.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-LENGTH><strong>CONTENT-LENGTH</strong></a></strong>&nbsp;(5)
<dd>Size of the resource, in bytes.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-LOCATION><strong>CONTENT-LOCATION</strong></a></strong>&nbsp;(51)
<dd>Resource location for the entity enclosed in the message.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-MD5><strong>CONTENT-MD5</strong></a></strong>&nbsp;(52)
<dd>MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) for the entity-body. For more information, see RFC1864, The Content-MD5 Header Field, at <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl05',this);" href="http://ftp.isi.edu/in-notes/rfc1864.txt"><u><font color=#0000ff>http://ftp.isi.edu/in-notes/rfc1864.txt</font></u></a>&nbsp;<img height=11 alt="World Wide Web link" src="http://msdn2.microsoft.com/en-us/library/ms537417.leave-site(en-us,VS.85).gif" width=17 border=0>.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-RANGE><strong>CONTENT-RANGE</strong></a></strong>&nbsp;(53)
<dd>Location in the full entity-body where the partial entity-body should be inserted and the total size of the full entity-body.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-TRANSFER_ENCODING><strong>CONTENT-TRANSFER_ENCODING</strong></a></strong>&nbsp;(2)
<dd>Additional content coding that has been applied to the resource.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=CONTENT-TYPE><strong>CONTENT-TYPE</strong></a></strong>&nbsp;(1)
<dd>Content type of the resource (such as text/html).
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=COOKIE><strong>COOKIE</strong></a></strong>&nbsp;(44)
<dd>Cookies associated with the request.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=COST><strong>COST</strong></a></strong>&nbsp;(15)
<dd>Not supported.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=DATE><strong>DATE</strong></a></strong>&nbsp;(9)
<dd>Date and time at which the message was originated.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=DERIVED-FROM><strong>DERIVED-FROM</strong></a></strong>&nbsp;(14)
<dd>Not supported.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ECHO-HEADERS><strong>ECHO-HEADERS</strong></a></strong>&nbsp;(73)
<dd>Not implemented.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ECHO-HEADERS-CRLF><strong>ECHO-HEADERS-CRLF</strong></a></strong>&nbsp;(74)
<dd>Not implemented.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ECHO-REPLY><strong>ECHO-REPLY</strong></a></strong>&nbsp;(72)
<dd>Not implemented.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ECHO-REQUEST><strong>ECHO-REQUEST</strong></a></strong>&nbsp;(71)
<dd>Not implemented.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ETAG><strong>ETAG</strong></a></strong>&nbsp;(54)
<dd>Entity tag for the associated entity.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=EXPECT><strong>EXPECT</strong></a></strong>&nbsp;(68)
<dd>Expect header, which indicates whether the client application should expect 100 series responses.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=EXPIRES><strong>EXPIRES</strong></a></strong>&nbsp;(10)
<dd>Date and time after which the resource should be considered outdated.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=FORWARDED><strong>FORWARDED</strong></a></strong>&nbsp;(30)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=FROM><strong>FROM</strong></a></strong>&nbsp;(31)
<dd>E-mail address for the human user who controls the requesting user agent if the From header is given.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=HOST><strong>HOST</strong></a></strong>&nbsp;(55)
<dd>Internet host and port number of the resource being requested.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=IF-MATCH><strong>IF-MATCH</strong></a></strong>&nbsp;(56)
<dd>Contents of the If-Match request-header field.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=IF-MODIFIED-SINCE><strong>IF-MODIFIED-SINCE</strong></a></strong>&nbsp;(32)
<dd>Contents of the If-Modified-Since header.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=IF-NONE-MATCH><strong>IF-NONE-MATCH</strong></a></strong>&nbsp;(57)
<dd>Contents of the If-None-Match request-header field.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=IF-RANGE><strong>IF-RANGE</strong></a></strong>&nbsp;(58)
<dd>Contents of the If-Range request-header field. This header allows the client application to check if the entity related to a partial copy of the entity in the client application's cache has not been updated. If the entity has not been updated, send the parts that the client application is missing. If the entity has been updated, send the entire updated entity.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=IF-UNMODIFIED-SINCE><strong>IF-UNMODIFIED-SINCE</strong></a></strong>&nbsp;(59)
<dd>Contents of the If-Unmodified-Since request-header field.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=LAST-MODIFIED><strong>LAST-MODIFIED</strong></a></strong>&nbsp;(11)
<dd>Date and time at which the server believes the resource was last modified.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=LINK><strong>LINK</strong></a></strong>&nbsp;(16)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=LOCATION><strong>LOCATION</strong></a></strong>&nbsp;(33)
<dd>Absolute URI.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=MAX><strong>MAX</strong></a></strong>&nbsp;(75)
<dd>Not a query flag. Indicates the maximum value of an * value.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=MAX-FORWARDS><strong>MAX-FORWARDS</strong></a></strong>&nbsp;(60)
<dd>Number of proxies or gateways that can forward the request to the next inbound server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=MESSAGE-ID><strong>MESSAGE-ID</strong></a></strong>&nbsp;(12)
<dd>Not supported.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=MIME-VERSION><strong>MIME-VERSION</strong></a></strong>&nbsp;(0)
<dd>Version of the MIME protocol that was used to construct the message.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=MSTHEMECOMPATIBLE><strong>MSTHEMECOMPATIBLE</strong></a></strong>&nbsp;
<dd>Microsoft Internet Explorer 6 and later. Disables theming support for a Web page. The <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl06',this);" href="http://msdn2.microsoft.com/en-us/library/ms533689.aspx"><u><font color=#0000ff>content</font></u></a> attribute of the <strong>meta</strong> element must be set to <code xmlns:msxsl="urn:schemas-microsoft-com:xslt">no</code>.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=ORIG-URI><strong>ORIG-URI</strong></a></strong>&nbsp;(34)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=PRAGMA><strong>PRAGMA</strong></a></strong>&nbsp;(17)
<dd>Implementation-specific directives that might apply to any recipient along the request/response chain.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=PROXY-AUTHENTICATE><strong>PROXY-AUTHENTICATE</strong></a></strong>&nbsp;(41)
<dd>Authentication scheme and realm returned by the proxy.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=PROXY-AUTHORIZATION><strong>PROXY-AUTHORIZATION</strong></a></strong>&nbsp;(61)
<dd>Header that is used to identify the user to a proxy that requires authentication. This header can only be retrieved before the request is sent to the server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=PROXY-CONNECTION><strong>PROXY-CONNECTION</strong></a></strong>&nbsp;(69)
<dd>Proxy-Connection header.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=PUBLIC><strong>PUBLIC</strong></a></strong>&nbsp;(8)
<dd>Methods available at this server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=RANGE><strong>RANGE</strong></a></strong>&nbsp;(62)
<dd>Byte range of an entity.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=RAW-HEADERS><strong>RAW-HEADERS</strong></a></strong>&nbsp;(21)
<dd>All the headers returned by the server. Each header is terminated by "\0". An additional "\0" terminates the list of headers.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=RAW-HEADERS-CRLF><strong>RAW-HEADERS-CRLF</strong></a></strong>&nbsp;(22)
<dd>All the headers returned by the server. Each header is separated by a carriage return/line feed (CR/LF) sequence.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=REFERER><strong>REFERER</strong></a></strong>&nbsp;(35)
<dd>URI of the resource where the requested URI was obtained.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=REFRESH><strong>REFRESH</strong></a></strong>&nbsp;(46)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=REQUEST-METHOD><strong>REQUEST-METHOD</strong></a></strong>&nbsp;(45)
<dd>Verb that is used in the request, typically GET or POST.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=RETRY-AFTER><strong>RETRY-AFTER</strong></a></strong>&nbsp;(36)
<dd>Amount of time the service is expected to be unavailable.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=SERVER><strong>SERVER</strong></a></strong>&nbsp;(37)
<dd>Information about the software used by the origin server to handle the request.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=SET-COOKIE><strong>SET-COOKIE</strong></a></strong>&nbsp;(43)
<dd>Value of the cookie set for the request.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=STATUS-CODE><strong>STATUS-CODE</strong></a></strong>&nbsp;(19)
<dd>Status code returned by the server. For a list of possible values, see <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl07',this);" href="http://msdn2.microsoft.com/en-us/library/aa384325.aspx"><u><font color=#0000ff>HTTP Status Codes</font></u></a>.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=STATUS-TEXT><strong>STATUS-TEXT</strong></a></strong>&nbsp;(20)
<dd>Any additional text returned by the server on the response line.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=TITLE><strong>TITLE</strong></a></strong>&nbsp;(38)
<dd>Obsolete. Maintained for legacy application compatibility only.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=TRANSFER-ENCODING><strong>TRANSFER-ENCODING</strong></a></strong>&nbsp;(63)
<dd>Type of transformation that has been applied to the message body so it can be safely transferred between the sender and recipient.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=UNLESS-MODIFIED-SINCE><strong>UNLESS-MODIFIED-SINCE</strong></a></strong>&nbsp;(70)
<dd>Unless-Modified-Since header.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=UPGRADE><strong>UPGRADE</strong></a></strong>&nbsp;(64)
<dd>Additional communication protocols that are supported by the server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=URI><strong>URI</strong></a></strong>&nbsp;(13)
<dd>Some or all of the URIs by which the Request-URI resource can be identified.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=USER-AGENT><strong>USER-AGENT</strong></a></strong>&nbsp;(39)
<dd>Information about the user agent that made the request.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=VARY><strong>VARY</strong></a></strong>&nbsp;(65)
<dd>Header that indicates that the entity was selected from a number of available representations of the response using server-driven negotiation.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=VERSION><strong>VERSION</strong></a></strong>&nbsp;(18)
<dd>Last response code returned by the server.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=VIA><strong>VIA</strong></a></strong>&nbsp;(66)
<dd>Intermediate protocols and recipients between the user agent and the server on requests, and between the origin server and the client on responses.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=WARNING><strong>WARNING</strong></a></strong>&nbsp;(67)
<dd>Additional information about the status of a response that might not be reflected by the response status code.
<p>
<dl class=clsRef><!----></dl>
<dt><strong><a name=WWW-AUTHENTICATE><strong>WWW-AUTHENTICATE</strong></a></strong>&nbsp;(40)
<dd>Authentication scheme and realm returned by the server.
<p>
<dl class=clsRef><!----></dl></dd></dl></blockquote>
<p class=clsRef>Remarks</p>
<blockquote>
<p>A response header can be created using the <a onclick="javascript:Track('ctl00_LibFrame_ctl01|ctl00_LibFrame_ctl08',this);" href="http://msdn2.microsoft.com/en-us/library/ms533876.aspx"><u><font color=#0000ff>HTTP-EQUIV</font></u></a> attribute of the <strong>meta</strong> tag.</p>
<p>Corresponding values are provided for use with <strong>HttpQueryInfo</strong> and <strong>QueryInfo</strong>.</p>
<p>In Internet Explorer 6, The MSTHEMECOMPATIBLE constant disables theming support within Web pages. </p>
</blockquote></div>
<img src ="http://www.cnitblog.com/asfman/aggbug/36217.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-13 09:35 <a href="http://www.cnitblog.com/asfman/articles/36217.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>just CusorType=1 will be ok</title><link>http://www.cnitblog.com/asfman/articles/36002.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Thu, 08 Nov 2007 01:00:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/36002.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/36002.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/36002.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/36002.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/36002.html</trackback:ping><description><![CDATA[当直接使用ActiveConnection的Execute时需要设置CursorLocation=3客户端游标，否这RecordCoun返回-1<br><br>当使用rs.Open(),只要设置CusorType=1 然后设置LockType=3就通用了<br>，如果不设置CusorType结果就会返回-1。所以通用设置为：<br>CursorType=1;<br>LockType=3;<br>CursorLocation=2//默认也是2 ，所设置不设置无所谓<br>var sql = "select * from messages order by id desc";<br>var Rs= Server.CreateObject("ADOR.RecordSet");<br>Rs.ActiveConnection=DH.ConnStr;<br>Rs.CursorType = 1;<br>Rs.LockType = 3;<br>//Rs.CursorLocation = 2;<br>Rs.Source = sql;<br>Rs.Open();<br>Response.Write(Rs.CursorType+"&lt;br&gt;");<br>Response.Write(Rs.LockType+"&lt;br&gt;");<br>Response.Write(Rs.CursorLocation+"&lt;br&gt;");<br>Response.Write(Rs.RecordCount);<br>
<img src ="http://www.cnitblog.com/asfman/aggbug/36002.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-08 09:00 <a href="http://www.cnitblog.com/asfman/articles/36002.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jscript ado &amp;&amp; adox 应用的几个技巧</title><link>http://www.cnitblog.com/asfman/articles/35861.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Sun, 04 Nov 2007 15:25:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/35861.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/35861.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/35861.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/35861.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/35861.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 说明:&nbsp;本文介绍了几个 asp/jscript 使用 ado&nbsp;操作数据库表的实用技巧.&nbsp;&nbsp;主要为:&nbsp;GetRows()&nbsp;GetString()&nbsp;Save()&nbsp;Open()&nbsp;&nbsp;及 adox 操作数据库的实用技巧, 为&nbsp;建,删,改 视图.&nbsp;建库&nbsp;建表+栏&nbsp;&nbs...&nbsp;&nbsp;<a href='http://www.cnitblog.com/asfman/articles/35861.html'>阅读全文</a><img src ="http://www.cnitblog.com/asfman/aggbug/35861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-04 23:25 <a href="http://www.cnitblog.com/asfman/articles/35861.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>服务端 jscript 生成随机数图片验证码 by shawl.qiu</title><link>http://www.cnitblog.com/asfman/articles/35860.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Sun, 04 Nov 2007 15:21:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/35860.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/35860.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/35860.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/35860.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/35860.html</trackback:ping><description><![CDATA[<a href="http://blog.csdn.net/btbtd/archive/2007/01/04/1473710.aspx">http://blog.csdn.net/btbtd/archive/2007/01/04/1473710.aspx</a><br>说明:<br>&nbsp;其实这个程序只是从某人写的一个VBScript程序改写成 Jscript 而已, 可以说不是我写的, 只是改改而已...<br>&nbsp;至于VBScript版原作者是谁, 我不知道(现在的网络转载大都没署原作来历)...<br>&nbsp;<br>&nbsp;原理嘛, 就是预存0-9的十六进制数据在数组A里, <br>&nbsp;然后生成一个随机数,<br>&nbsp;把随机数存放进 Session 里, 以备进行提交检验,<br>&nbsp;再生成一个数组B, 数组B内容的每个项对应随机数的一个字符.<br>&nbsp;然后循环输出数组A, 以数组B的每一个项内容访问存放十六进制数组A的数据,<br>&nbsp;最后使用 xbm 格式输出图片数据.<br>&nbsp;<br>&nbsp;鄙人弄了一个演示, 共两个文件.<br>&nbsp;test.asp 调用生成随机图片数据.<br>&nbsp;checkcode.asp 生成随机图片数据.<br>&nbsp;<br>&nbsp;下载原格式:<br><span>&nbsp;&nbsp;<a class=sqUrl href="http://files.myopera.com/btbtd/jscript_ss/function/jscript_rnd_num_pic_validator.7z"><u><font color=#0000ff>http://files.myopera.com/btbtd/jscript_ss/function/jscript_rnd_num_pic_validator.7z</font></u></a></span><br><br>&nbsp;目录:<br>&nbsp;1. test.asp 源代码<br>&nbsp;2. checkcode.asp 源代码<br>&nbsp;&nbsp;<br>&nbsp;shawl.qiu <br>&nbsp;2007-01-04<br><span>&nbsp;<a class=sqUrl href="http://blog.csdn.net/btbtd"><u><font color=#0000ff>http://blog.csdn.net/btbtd</font></u></a></span><br>&nbsp;<br>&nbsp;1. test.asp 源代码
<div class=sqDiv>
<ol>
    <li><span><span><span><span>&lt;%@</span></span></span></span><span style="COLOR: #0000ff">LANGUAGE</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">"JAVASCRIPT"&nbsp;</span><span style="COLOR: #0000ff">CODEPAGE</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">"65001"%&gt;</span>
    <li>&lt;!<span style="COLOR: #ff0000">DOCTYPE</span>&nbsp;<span style="COLOR: #0000ff">html</span>&nbsp;<span style="COLOR: #0000ff">PUBLIC</span>&nbsp;"-//W3C//DTD&nbsp;<span style="COLOR: #0000ff">XHTML</span>&nbsp;<span style="COLOR: #0000ff">1.0</span>&nbsp;<span style="COLOR: #0000ff">Transitional//EN</span>"&nbsp;"<span style="COLOR: #ff00ff"><span><a class=sqUrl href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><u><font color=#0000ff>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</font></u></a></span></span>"&gt;
    <li>&lt;<span style="COLOR: #ff0000">html&nbsp;</span><span style="COLOR: #0000ff">xmlns</span>="<span style="COLOR: #ff00ff"><span><a class=sqUrl href="http://www.w3.org/1999/xhtml"><u><font color=#0000ff>http://www.w3.org/1999/xhtml</font></u></a></span></span>"&gt;
    <li>&lt;<span style="COLOR: #ff0000">head</span>&gt;
    <li>&lt;<span style="COLOR: #ff0000"><span><span><span><span>meta&nbsp;http-</span></span></span></span></span><span style="COLOR: #0000ff">equiv</span>="<span style="COLOR: #ff00ff">Content-Type</span>"&nbsp;<span style="COLOR: #0000ff">content</span>="<span style="COLOR: #ff00ff">text/html;&nbsp;</span><span style="COLOR: #0000ff">charset</span>=utf-8"&nbsp;/&gt;
    <li>&lt;<span style="COLOR: #ff0000">title</span>&gt;shawl.qiu&nbsp;template&lt;/<span style="COLOR: #ff0000">title</span>&gt;
    <li>&lt;/<span style="COLOR: #ff0000">head</span>&gt;
    <li>&lt;<span style="COLOR: #ff0000">body</span>&gt;
    <li>&lt;%
    <li>&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">sCk</span><span style="COLOR: #ffa500">=</span><font color=#0000ff><span style="COLOR: #ff0000">Request</span>.QueryString(<span style="COLOR: #ff00ff">'id'</span>)</font>+'';
    <li>&nbsp;<span style="FONT-WEIGHT: 700">switch</span>(sCk){
    <li>&nbsp;<span style="FONT-WEIGHT: 700">case</span>&nbsp;'check':
    <li>&nbsp;&nbsp;<font color=#0000ff><span style="COLOR: #ff0000">Response</span>.<span style="COLOR: #0000ff">write</span>(<span style="COLOR: #ff00ff">"Session('checkcode'</span>):&nbsp;"+Session(<span style="COLOR: #ff00ff">'checkcode'</span>))</font>;
    <li>&nbsp;&nbsp;<font color=#0000ff><span style="COLOR: #ff0000">Response</span>.<span style="COLOR: #0000ff">write</span>(<span style="COLOR: #ff00ff">"&lt;<span style="COLOR: #ff0000">br</span>/&gt;<span style="COLOR: #ff0000">Request</span>.Form('checkcode'</span>):&nbsp;"+<span style="COLOR: #ff0000">Request</span>.Form(<span style="COLOR: #ff00ff">'checkcode'</span>))</font>;
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">break</span>;
    <li>&nbsp;<span style="FONT-WEIGHT: 700">default</span>:
    <li>%&gt;
    <li>&lt;<span style="COLOR: #ff0000">img&nbsp;</span><span style="COLOR: #0000ff">src</span>='<span style="COLOR: #ff00ff">checkcode.asp</span>'&nbsp;/&gt;
    <li>&lt;<span style="COLOR: #ff0000">form&nbsp;</span><span style="COLOR: #0000ff">action</span>='<span style="COLOR: #ff00ff">?</span><span style="COLOR: #0000ff">id</span>=check'&nbsp;<span style="COLOR: #0000ff">method</span>='<span style="COLOR: #ff00ff">post</span>'&gt;
    <li>&nbsp;the&nbsp;code:&lt;<span style="COLOR: #ff0000">input&nbsp;</span><span style="COLOR: #0000ff">type</span>='<span style="COLOR: #ff00ff">text</span>'&nbsp;<span style="COLOR: #0000ff">size</span>='<span style="COLOR: #ff00ff">4</span>'&nbsp;<span style="COLOR: #0000ff">name</span>='<span style="COLOR: #ff00ff">checkcode</span>'/&gt;
    <li>&nbsp;&lt;<span style="COLOR: #ff0000">input&nbsp;</span><span style="COLOR: #0000ff">type</span>='<span style="COLOR: #ff00ff">submit</span>'&nbsp;/&gt;&nbsp;&lt;input&nbsp;<span style="COLOR: #0000ff">type</span>='<span style="COLOR: #ff00ff">reset</span>'&nbsp;/&gt;
    <li>&lt;/<span style="COLOR: #ff0000">form</span>&gt;
    <li>&lt;%
    <li>&nbsp;}
    <li>%&gt;
    <li>&lt;/<span style="COLOR: #ff0000">body</span>&gt;
    <li>&lt;/<span style="COLOR: #ff0000">html</span>&gt;</li>
</ol>
</div>
&nbsp;2. checkcode.asp 源代码
<div class=sqDiv>
<ol>
    <li><span><span><span><span>&lt;%@</span></span></span></span><span style="COLOR: #0000ff">LANGUAGE</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">"JAVASCRIPT"&nbsp;</span><span style="COLOR: #0000ff">CODEPAGE</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">"65001"%&gt;</span>
    <li>&lt;%
    <li>&nbsp;checkcode(1000,9999,'checkcode');
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">function</span>&nbsp;checkcode(nStart,&nbsp;nOver,&nbsp;sSession){
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">if</span>(!nStart)&nbsp;<span style="COLOR: #0000ff">nStart</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">1000;</span>
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">if</span>(!nOver)&nbsp;<span style="COLOR: #0000ff">nOver</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">9999;</span>
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">if</span>(!sSession)&nbsp;<span style="COLOR: #0000ff">sSession</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">'checkcode';</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">ar</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">[<span style="COLOR: #ff00ff">10</span>];</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">0</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">0</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x3c',&nbsp;'0x66',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0x66',&nbsp;'0x3c'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">1</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">1</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x18',&nbsp;'0x1c',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x7e'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">2</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">2</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x3c',&nbsp;'0x66',&nbsp;'0x60',&nbsp;'0x60',&nbsp;'0x30',&nbsp;'0x18',&nbsp;'0x0c',&nbsp;'0x06',&nbsp;'0x06',&nbsp;'0x7e'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">3</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">3</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x3c',&nbsp;'0x66',&nbsp;'0xc0',&nbsp;'0x60',&nbsp;'0x1c',&nbsp;'0x60',&nbsp;'0xc0',&nbsp;'0xc0',&nbsp;'0x66',&nbsp;'0x38'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">4</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">4</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x38',&nbsp;'0x3c',&nbsp;'0x36',&nbsp;'0x33',&nbsp;'0x33',&nbsp;'0x33',&nbsp;'0xff',&nbsp;'0x30',&nbsp;'0x30',&nbsp;'0xfe'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">5</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">5</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0xfe',&nbsp;'0xfe',&nbsp;'0x06',&nbsp;'0x06',&nbsp;'0x3e',&nbsp;'0x60',&nbsp;'0xc0',&nbsp;'0xc3',&nbsp;'0x66',&nbsp;'0x3c'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">6</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">6</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x60',&nbsp;'0x30',&nbsp;'0x18',&nbsp;'0x0c',&nbsp;'0x3e',&nbsp;'0x63',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0x66',&nbsp;'0x3c'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">7</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">7</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0xff',&nbsp;'0xc0',&nbsp;'0x60',&nbsp;'0x30',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18',&nbsp;'0x18'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">8</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">8</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x3c',&nbsp;'0x66',&nbsp;'0xc3',&nbsp;'0x66',&nbsp;'0x3c',&nbsp;'0x66',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0x66',&nbsp;'0x3c'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;//<span style="COLOR: #cccccc">9</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">ar[<span style="COLOR: #ff00ff">9</span>]</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000"><span style="FONT-WEIGHT: 700">new</span>&nbsp;<span style="FONT-WEIGHT: 700">Array</span>(<span style="COLOR: #ff00ff">'0x3c',&nbsp;'0x66',&nbsp;'0xc3',&nbsp;'0xc3',&nbsp;'0x66',&nbsp;'0x3c',&nbsp;'0x18',&nbsp;'0x0c',&nbsp;'0x06',&nbsp;'0x03'</span>);</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;//<span style="COLOR: #0000ff"><span style="COLOR: #ff0000">Response</span>.Buffer</span>&nbsp;<span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">&nbsp;<span style="FONT-WEIGHT: 700">false</span>;</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;with(<span style="COLOR: #ff0000">Response</span>){
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">Expires</span>&nbsp;<span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">&nbsp;-1&nbsp;;</span>
    <li>&nbsp;&nbsp;&nbsp;AddHeader("Pragma","no-cache")&nbsp;;
    <li>&nbsp;&nbsp;&nbsp;AddHeader("cache-ctrol","no-cache");&nbsp;
    <li>&nbsp;&nbsp;}
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">nNum</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">fRandomBy(<span style="COLOR: #ff00ff">nStart,nOver</span>)+'';</span>
    <li>&nbsp;&nbsp;Session(sSession)<span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">nNum;</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;//<font color=#0000ff><span style="COLOR: #ff0000">Response</span>.<span style="COLOR: #0000ff">write</span>(<span style="COLOR: #ff00ff">Session(sSession</span>))</font>;
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">arDg</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">[];</span>
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">for</span>(<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">i</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">0;&nbsp;i&lt;</span><font color=#0000ff>nNum.length;&nbsp;i++)</font>{
    <li>&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">arDg[<span style="COLOR: #ff00ff">i</span>]</span><span style="COLOR: #ffa500">=</span><font color=#0000ff>nNum.charAt(<span style="COLOR: #ff00ff">i</span>)</font>;
    <li>&nbsp;&nbsp;}
    <li>&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">sMarker</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">'\r\n';</span>
    <li>&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">nWidth</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">8*arDg.length;</span>
    <li>&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">nHeight</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">10;&nbsp;</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff"><span style="COLOR: #ff0000">Response</span>.ContentType</span>&nbsp;<span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">&nbsp;"image/x-xbitmap"</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">sImg</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">'#define&nbsp;counter_width&nbsp;'+nWidth+sMarker+</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;'#define&nbsp;counter_height&nbsp;'+nHeight+sMarker+
    <li>&nbsp;&nbsp;&nbsp;&nbsp;'static&nbsp;unsigned&nbsp;char&nbsp;<span style="COLOR: #0000ff">counter_bits[]</span>&nbsp;<span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">&nbsp;{'+sMarker</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">for</span>(<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">i</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">0;&nbsp;i&lt;10;&nbsp;i++){</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">for</span>(<span style="FONT-WEIGHT: 700">var</span>&nbsp;<span style="COLOR: #0000ff">j</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">0,&nbsp;</span><span style="COLOR: #0000ff">k</span><span style="COLOR: #ffa500">=</span><font color=#0000ff>arDg.length;&nbsp;j&lt;k;&nbsp;j++)</font>{
    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">sImg+</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">ar[arDg[<span style="COLOR: #ff00ff">j]</span>][<span style="COLOR: #ff00ff">i</span>]+',';</span>
    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
    <li>&nbsp;&nbsp;&nbsp;&nbsp;}
    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">sImg</span><span style="COLOR: #ffa500">=</span><font color=#0000ff>sImg.replace(<span style="COLOR: #ff00ff">/\,$/,''</span>)</font>;
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff">sImg+</span><span style="COLOR: #ffa500">=</span><span style="COLOR: #ff0000">'};'+sMarker;</span>
    <li>&nbsp;&nbsp;<font color=#0000ff><span style="COLOR: #ff0000">Response</span>.<span style="COLOR: #0000ff">write</span>(<span style="COLOR: #ff00ff">sImg</span>)</font>;&nbsp;
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">function</span>&nbsp;fRandomBy(nUnder,&nbsp;nOver){
    <li>&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">switch</span>(<font color=#0000ff>arguments.length)</font>{
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">case</span>&nbsp;1:&nbsp;<span style="FONT-WEIGHT: 700">return</span>&nbsp;parseInt(<font color=#0000ff>Math.random()*nUnder+1)</font>;
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">case</span>&nbsp;2:&nbsp;<span style="FONT-WEIGHT: 700">return</span>&nbsp;parseInt(<font color=#0000ff>Math.random()*(<span style="COLOR: #ff00ff">nOver-nUnder+1</span>)&nbsp;+&nbsp;nUnder)</font>;
    <li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: 700">default</span>:&nbsp;<span style="FONT-WEIGHT: 700">return</span>&nbsp;0;
    <li>&nbsp;&nbsp;&nbsp;}
    <li>&nbsp;&nbsp;}&nbsp;&nbsp;//<span style="COLOR: #cccccc">&nbsp;shawl.qiu&nbsp;code</span>
    <li>&nbsp;}&nbsp;//<span style="COLOR: #cccccc">&nbsp;end&nbsp;</span><span style="FONT-WEIGHT: 700">function</span>&nbsp;checkcode(nStart,&nbsp;nOver,&nbsp;sSession)&nbsp;
    <li>%&gt;</li>
</ol>
</div>
<img src ="http://www.cnitblog.com/asfman/aggbug/35860.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-04 23:21 <a href="http://www.cnitblog.com/asfman/articles/35860.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于留言版的自由回复</title><link>http://www.cnitblog.com/asfman/articles/35793.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Sat, 03 Nov 2007 17:30:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/35793.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/35793.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/35793.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/35793.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/35793.html</trackback:ping><description><![CDATA[<p>&lt;<a href='&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#37;&#64;&#76;&#97;&#110;&#103;&#117;&#97;&#103;&#101;&#61;&#34;&#74;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#34;&#37;'>%@Language="Javascript"%</a>&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;style&gt;<br>.replyDiv{<br>border:1px solid #999;<br>}<br>.reply{<br>border:1px solid #ccc;<br>margin:5px;<br>}<br>&lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;</p>
<p>&lt;%<br>var conn = Server.CreateObject("ADODB.Connection");<br>var connStr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source="+Server.MapPath("asfman.mdb");<br>conn.Open(connStr);</p>
<p>var Rs = Server.CreateObject("ADODB.RecordSet");<br>Rs.Open("select * from messages",conn,1,1);<br>while(!Rs.EOF)<br>{<br>&nbsp;for(var i = 0;i&lt;Rs.Fields.Count;i++)<br>&nbsp;{<br>&nbsp;&nbsp;var temp = "";<br>&nbsp;&nbsp;if(Rs.Fields(i).Name ==&nbsp; "reply")<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;temp = Rs.Fields(i).Value;<br>&nbsp;&nbsp;&nbsp;var arr = temp.match(/[^\f]+/g);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var str = arr.length? "&lt;div class=\"replyDiv\"&gt;":"";<br>&nbsp;&nbsp;&nbsp;for(var j = 0;j&lt;arr.length;j++)<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;str = str +"&lt;div class=\"reply\"&gt;";<br>&nbsp;&nbsp;&nbsp;&nbsp;var arr2 = arr[j].match(/[^\b]+/g);<br>&nbsp;&nbsp;&nbsp;&nbsp;for(var k=0;k&lt;arr2.length;k++)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp; = str&nbsp; + (arr2[k]+"&lt;br /&gt;");<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;str = str +"&lt;/div&gt;";<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;str = str?(str+"&lt;/div&gt;"):"";<br>&nbsp;&nbsp;}else<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;Response.Write(Rs.Fields(i).Value+"&lt;br /&gt;");<br>&nbsp;&nbsp;}</p>
<p>&nbsp;}<br>&nbsp;Response.Write(str);<br>&nbsp;Rs.MoveNext();<br>}<br>Rs.Close();<br>conn.Close();<br>conn = null;<br>Rs = null;<br>%&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&lt;<a href='&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#37;&#64;&#76;&#97;&#110;&#103;&#117;&#97;&#103;&#101;&#61;&#34;&#74;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#34;&#37;'>%@Language="Javascript"%</a>&gt;<br>&lt;%<br>var conn = Server.CreateObject("ADODB.Connection");<br>var connStr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source="+Server.MapPath("asfman.mdb");<br>conn.Open(connStr);<br>var sql="insert into messages(name,content,ipAddress,reply,_time) values('asfman2','test','122','\f汪杰\b这是一个测试\b127.0.0.1\b2007-11-4\fasfman\bjust a test\b127.0.0.1\b2007-11-4',now())";<br>conn.Execute(sql);<br>Response.Write("ok");<br>%&gt;</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/35793.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-11-04 01:30 <a href="http://www.cnitblog.com/asfman/articles/35793.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>setRquestHeader使用实例1</title><link>http://www.cnitblog.com/asfman/articles/35281.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Wed, 24 Oct 2007 07:41:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/35281.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/35281.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/35281.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/35281.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/35281.html</trackback:ping><description><![CDATA[<p>&lt;<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#37;&#64;&#76;&#97;&#110;&#103;&#117;&#97;&#103;&#101;">%@Language</a> = "Javascript" %&gt;<br>&lt;%<br>//Response.Write(Request.ServerVariables("http_accept"));<br>&nbsp;var a=Request.QueryString('a').Item;<br>&nbsp;var b=Request.QueryString('b').Item;<br>&nbsp;if(!a){total="";}<br>&nbsp;else{<br>&nbsp;var total=a-0+(b-0);}<br>&nbsp;acc=Request.ServerVariables('HTTP_ACCEPT')+''<br>&nbsp;if (acc.indexOf('asfman')!=-1) {<br>&nbsp; Response.Write(total)<br>&nbsp;} else {<br>%&gt;<br>&lt;script&gt;<br>var xmlhttp = new XMLHttpRequest();<br>&nbsp;function calc() {<br>&nbsp; frm=document.forms[0]<br>&nbsp; url="?a="+frm.elements['a'].value+"&amp;b="+frm.elements['b'].value<br>&nbsp; xmlhttp.open("GET",url,true);<br>&nbsp; xmlhttp.onreadystatechange=function() {<br>&nbsp;&nbsp; if (xmlhttp.readyState==4) {<br>&nbsp;&nbsp;&nbsp; document.forms[0].elements['total'].value=xmlhttp.responseText<br>&nbsp;&nbsp; }<br>&nbsp; }<br>&nbsp;xmlhttp.setRequestHeader('Accept','asfman');<br>&nbsp;xmlhttp.send()<br>&nbsp;return false<br>}<br>&lt;/script&gt;<br>&lt;form action="" method="get" onsubmit="return calc()"&gt;<br>&lt;input type=text name=a value="&lt;%=a%&gt;"&gt; + &lt;input type=text name=b value="&lt;%=b%&gt;"&gt;<br>&nbsp;= &lt;input type=text name=total value="&lt;%=total%&gt;"&gt;<br>&lt;input type=submit value="Calculate"&gt;<br>&lt;/form&gt;<br>&lt;%<br>}<br>%&gt;</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/35281.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-10-24 15:41 <a href="http://www.cnitblog.com/asfman/articles/35281.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>create xml file</title><link>http://www.cnitblog.com/asfman/articles/31359.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 06 Aug 2007 15:05:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/31359.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/31359.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/31359.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/31359.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/31359.html</trackback:ping><description><![CDATA[&lt;%@ Language="Javascript" %&gt;<br>&lt;%<br>var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");<br>var root=xmlDoc.createElement("information");<br>xmlDoc.appendChild(root);<br>for(var i=1;i&lt;=Request.Form.Count;i++)<br>{<br>&nbsp;if(Request.Form.Key(i)!="sub")<br>&nbsp;{<br>&nbsp; for(var j=1;j&lt;=Request.Form(i).Count;j++)<br>&nbsp; {<br>&nbsp;&nbsp; var field=xmlDoc.createElement("field");<br>&nbsp;&nbsp; var attID=xmlDoc.createAttribute("ID");<br>&nbsp;&nbsp; attID.text=Request.Form.Key(i);<br>&nbsp;&nbsp; field.setAttributeNode(attID);<br>&nbsp;&nbsp; var value=xmlDoc.createElement("value");<br>&nbsp;&nbsp; value.text=Request.Form(i)(j);<br>&nbsp;&nbsp; field.appendChild(value);<br>&nbsp;&nbsp; root.appendChild(field);<br>&nbsp; }<br>&nbsp;}<br>}<br>var p=xmlDoc.createProcessingInstruction("xml","version='1.0' encoding='gb2312'");<br>xmlDoc.insertBefore(p,root);<br>xmlDoc.save(Server.Mappath("information.xml"));<br>Response.Write("saved information.xml successfully!");<br>%&gt;
<img src ="http://www.cnitblog.com/asfman/aggbug/31359.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-08-06 23:05 <a href="http://www.cnitblog.com/asfman/articles/31359.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OLEDB连接方法</title><link>http://www.cnitblog.com/asfman/articles/31271.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Sun, 05 Aug 2007 10:12:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/31271.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/31271.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/31271.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/31271.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/31271.html</trackback:ping><description><![CDATA[ASP中连接数据库(ADODB对象)：<br><br>一、OLEDB连接方法<br><br>1.OLE DB Provider for AS/400 <br>connstr = "Provider=IBMDA400;" Data source=myAS400;User Id=myUsername;Password=myPassword;"<br><br>2.OLE DB Provider for Active Directory Service <br>connstr = "Provider=ADSDSOObject;User Id=myUsername;Password=myPassword;"<br><br>3.OLE DB Provider for DB2 <br>connstr = "Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=MyServer;Package Collection=MyPackage;Host CCSID=1142Initial Catalog=MyDB;User ID=MyUsername;Password=MyPassword;"<br><br>4.OLE DB Provider for Index Server <br>connstr = "Provider=msidxs;Data source=MyCatalog;"<br><br>5.OLE DB Provider for Internet Publishing <br>connstr = "Provider=MSDAIPP.DSO;Data Source=url;User Id=myUsername;Password=myPassword;" <br><br>6.OLE DB Provider for Microsoft Jet(access-this way will be best) <br>connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbpath;User Id=admin;Password=;"<br><br>7.OLE DB Provider for Microsoft Jet(Excel)<br>connstr = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbpath;Extended Properties=""Excel 8.0;HDR=Yes;"";" <br><br>["HDR=Yes" means that there is a header row in the cell range (or named range), so the provider will not include the first row of the selection into the recordset. If "HDR=No", then the provider will include　the first row of the cell range (or named ranged) into the recordset]<br><br>9.OLE DB Provider for Microsoft Jet(textfile)<br>connstr = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbpath;Extended Properties=""text;HDR=Yes;FMT=Delimited;"";" <br><br>10.OLE DB Provider for ODBC Databases(access)<br>connstr = "Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};Dbq=dbpath;Uid=myUsername;Pwd=myPassword;"<br><br>11.OLE DB Provider for ODBC Databases(SQL) <br>connstr = "Provider=MSDASQL;Driver={SQL Server};Server=myServerName;Database=myDatabaseName;Uid=myUsername;"Pwd=myPassword;"<br><br>12.OLE DB Provider for Oracle (from Microsoft) <br>connstr = "Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;"<br><br>13.OLE DB Provider for Simple Provider <br>connstr = "Provider=MSDAOSP;Data Source=MSXML2.DSOControl.2.6;"<br><br>14.OLE DB Provider for SQL Server <br>"Provider=sqloledb;Data Source=myServerName;Initial Catalog=myDatabaseName;User Id=myUsername;Password=myPassword;"<br><br>[if connection with ip address]<br>connstr = "Provider=sqloledb;Data Source=xxx.xxx.xxx.xxx,1433;Network Library=DBMSSOCN;Initial Catalog=myDatabaseName;User ID=myUsername;Password=myPassword;" <br><br>[1433　为SQL数据库默认接口]<br>
<img src ="http://www.cnitblog.com/asfman/aggbug/31271.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-08-05 18:12 <a href="http://www.cnitblog.com/asfman/articles/31271.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js send email class from wscript.cn</title><link>http://www.cnitblog.com/asfman/articles/28575.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Sat, 16 Jun 2007 07:30:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/28575.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/28575.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/28575.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/28575.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/28575.html</trackback:ping><description><![CDATA[&lt;%@Language="JScript" codepage="936"%&gt;<br>&lt;%<br>function aspMailClass(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var fromMail = "test@test.com";&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;var fromServ = "smtp.test.com";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//smtp服务器<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var fromProt = 25;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//smtp服务器端口<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var fromName = "无忧脚本";&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;var fromUser = "51js";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;var fromPass = "51js";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;this.sendMail = function(toEmail, toTitle, toBody){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {<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;var byMail = new ActiveXObject("CDO.Configuration");<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;var fields = byMail.Fields;<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;var cfgUrl = "http://schemas.microsoft.com/cdo/configuration/";<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;fields(cfgUrl + "sendusing") = 2;&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;fields(cfgUrl + "smtpserver") = fromServ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//smtp服务器<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;fields(cfgUrl + "smtpserverport") = fromProt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//smtp服务器端口<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;fields(cfgUrl + "smtpaccountname") = fromMail;&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;fields(cfgUrl + "sendemailaddress") = fromMail;&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;fields(cfgUrl + "smtpauthenticate") = 1;&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;fields(cfgUrl + "sendusername") = fromUser;&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;fields(cfgUrl + "sendpassword") = fromPass;&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;fields.Update();<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;var oMail = new ActiveXObject("CDO.Message");<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;with(oMail){<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To = toEmail;<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subject = toTitle;<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLBody = toBody;<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;From = fromName + "&lt;" + fromMail + "&gt;";<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configuration = byMail;<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mimeformatted = true;<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AutoGenerateTextBody = true;<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fields.Update();<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLBodyPart.Charset = "gb2312";<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Send();<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;}<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;oMail = null;<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;fields = null;<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;byMail = null;<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;return this.result = "邮件成功发送至" + toEmail + "！";<br>&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;catch(e) {<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;return this.result = "发送至" + toEmail + "的邮件发送失败！失败原因：" + e.description;<br>&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;}<br>}<br><br>//实例<br>var toMail = new aspMailClass();<br>toMail.sendMail("xxx@xxx.com", "欢迎来到无忧脚本", "主题&lt;font color=red&gt;主题2&lt;/font&gt;");<br>Response.Write(toMail.result);<br>toMail = null;<br>%&gt;
<img src ="http://www.cnitblog.com/asfman/aggbug/28575.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-06-16 15:30 <a href="http://www.cnitblog.com/asfman/articles/28575.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于xmlhttp.responseText</title><link>http://www.cnitblog.com/asfman/articles/28368.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Tue, 12 Jun 2007 14:47:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/28368.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/28368.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/28368.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/28368.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/28368.html</trackback:ping><description><![CDATA[<p>只要子读取文件设置有Response.Charset就可以正常读取，如果没有设置的话，默认是按utf-8读取，所有对于ansi文件我们最好设置Response.Charset，从来可以避免自己去解码responseBody</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/28368.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-06-12 22:47 <a href="http://www.cnitblog.com/asfman/articles/28368.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于sct编写、调用需要注意的</title><link>http://www.cnitblog.com/asfman/articles/28151.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Thu, 07 Jun 2007 02:06:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/28151.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/28151.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/28151.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/28151.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/28151.html</trackback:ping><description><![CDATA[用Jscript写sct:<br>method指定的方法名必须与脚本的名字相同，符合js是区分大小写的。<br>用VBScript谢sct:<br>method指定的方法名不区分大小写。<br>note:<br>一旦指定了方法名，调用的时候就要用这个方法名，区分大小写<br>eg:<br>&lt;method name="test" /&gt;<br>无论js还是vbs写，调用的时候都得o.test()，用o.Test等等将出错 
<img src ="http://www.cnitblog.com/asfman/aggbug/28151.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-06-07 10:06 <a href="http://www.cnitblog.com/asfman/articles/28151.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>http协议简介</title><link>http://www.cnitblog.com/asfman/articles/27781.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Wed, 30 May 2007 05:44:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/27781.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/27781.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/27781.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/27781.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/27781.html</trackback:ping><description><![CDATA[<p><strong>什么是HTTP协议</strong><br><br>HTTP 协议定义服务器端和客户端之间文件传输的沟通方式。目前HTTP协议的版本是Http1.1。<a href="http://www.rfc-editor.org/rfc/rfc2616.txt"><u><font color=#0000ff>RFC 2616</font></u></a>描述了HTTP协议的具体信息。 <br><br>这个协议已经成为浏览器和Web站点之间的标准。</p>
<p><span class=style1>当我上网的时候底层是如何进行交互的？</span><br><br>当访问者点击一个超链接的时候，将会给浏览器提交一个URL地址。通过这个URL地址，浏览器便知道去链接那个网站并去取得具体的页面文件（也可能是一张图片，一个pdf文件）。<br><br>HTTP工作的基础就是，连接一个服务器并开始传输文件到浏览器。</p>
<p><strong>HTTP传输的基本过程</strong><br><br><span class=style2>在http传输的过程中，被称为客户端的请求者向服务器请求一个文件。<br><br>最基本的过程是:<br>1 客户端连接一个主机；<br>2 服务器接收连接, <br>3 客户端请求一个文件, <br>4 服务器发送一个应答.</span> </p>
<p><strong>实例</strong><br><br><span class=style2>我们看几个典型的过程<br><br>首先，我们想访问本页面。在浏览器上敲入&#8220;http://www.maketop.net/resource/rs_041112_02.php&#8221;.浏览器将连接www.maketop.net然后发送：</span><br><br>&gt;&gt; GET /resource/rs_041112_02.php Http1.1 <br>&gt;&gt; Host: www.maketop.net<br>&gt;&gt; Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, <br>&gt;&gt; Accept-Language: en <br>&gt;&gt; Accept-Encoding: gzip, deflate <br>&gt;&gt; User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10<br>&gt;&gt; Connection: Keep-Alive <br>&gt;&gt; <br><br><span class=style2>解释：浏览器请求页面&#8220;/resource/rs_041112_02.php&#8221;。并使用HTTP1.1协 议。并告诉服务器你的浏览器是Firefox0.10。操作系统是Windows XP。 浏览器希望保持与www.maketop.net之间的连接，并请求获得多的文件，包括网页中的图片。翻译成语言上面是：</span></p>
<p>&gt;&gt; 用HTTP1.1协议获得 /resource/rs_041112_02.php<br>&gt;&gt; 访问的主机是: www.maketop.net<br>&gt;&gt; 接收的文件包括了: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, <br>&gt;&gt; 使用的语言是: en <br>&gt;&gt; 接收的编码方式（浏览器能够解释的）是: gzip, deflate <br>&gt;&gt; 用户的浏览器信息:Windows XP的操作系统 Firefox/0.10的浏览器<br>&gt;&gt; 保持连接: 还要去图片<br>&gt;&gt; </p>
<p><a name=httpsamples><span class=style2><br><br>www.maketop.net的服务器发出响应：</span><br><br>&lt;&lt; HTTP/1.1 200 OK <br>&lt;&lt; Date: Mon, 12 Mar 2004 19:12:16 GMT <br>&lt;&lt; Server: Apache/1.3.31 (Unix) mod_throttle/3.1.2<br>&lt;&lt; Last-Modified: Fri, 22 Sep 2004 14:16:18 <br>&lt;&lt; ETag: "dd7b6e-d29-39cb69b2" <br>&lt;&lt; Accept-Ranges: bytes <br>&lt;&lt; Content-Length: 3369 <br>&lt;&lt; Connection: close <br>&lt;&lt; Content-Type: text/html <br>&lt;&lt; <br>&lt;&lt; File content goes here <br><br><span class=style2>浏览器并从服务器的响应中获得服务器的信息：比如运行在Apache。</span><br><span class=style2>上面翻译成翻译成语言上面就是</span></a></p>
<a name=httpsamples></a><a name=httpsamples>&lt;&lt; HTTP1.1协议方式有效<br>&lt;&lt; 当前时间是: Mon, 12 Mar 2004 19:12:16 GMT <br>&lt;&lt; 服务器是: Apache/1.3.31 (Unix) mod_throttle/3.1.2<br>&lt;&lt; 最后一次修改: Fri, 22 Sep 2004 14:16:18 <br>&lt;&lt; ETag: "dd7b6e-d29-39cb69b2" <br>&lt;&lt; Accept-Ranges: bytes <br>&lt;&lt; Content-Length: 3369 <br>&lt;&lt; Connection: close <br>&lt;&lt; Content-Type: text/html <br>&lt;&lt; <br>&lt;&lt; File content goes here <br><br>上面例子就是最简单的交互过程描述，需要对HTTP协议中具体的命令了解，就需要阅读</a><a href="http://www.rfc-editor.org/rfc/rfc2616.txt"><u><font color=#0000ff>RFC 2616</font></u></a> <br>本页网址: http://sohotx.com/mzk/index.php/1007/ArticleContent/429.html 
<img src ="http://www.cnitblog.com/asfman/aggbug/27781.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-05-30 13:44 <a href="http://www.cnitblog.com/asfman/articles/27781.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSP学习</title><link>http://www.cnitblog.com/asfman/articles/27688.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 28 May 2007 03:05:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/27688.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/27688.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/27688.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/27688.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/27688.html</trackback:ping><description><![CDATA[如何成为一个成功的Jsp程序员？一个普通的错误是把JSP当作简化的Java。它不是，（事实上， JSP是简化的 servlets。）程序员通常试着没有学习要求的支持技巧而直接学习JSP。JSP 是一个衔接技术，并且成功地连接你需要理解的另外的技术。如果你已经知道Java，HTML和Javascript，这意味着JSP将确实是简单的。 <br><br><br>　　需要成为一个成功的 JSP 程序员可以参考这个时间表。请注意下列： <br><br>　　*忽略你已经熟悉的步骤。 <br>　　*训练的时间只是代表学习好足够的基础时间，这样才能转移到下一步。 <br><br>　　１、建立并且理解你的Web Server。 <br>　　因为Apache 是免费的并且在大多数平台上工作，为训练目的推荐 Apache。 <br>　　安装时间：2 天。 <br><br>　　２、保证你理解 HTML / XHTML 。 <br>　　你将需要了解html基础, 特别是 HTML 布局中的table的使用。XHTML 不久将代替 HTML ，学习 XHTML 的基础是一个好主意。许多程序员通过 HTML IDE 学习 HTML ( 集成开发环境 ) 。因为大多数 HTML IDE产生混乱的HTMl语法，所以花时间学习手工写作html是很有必要的。因 为你将会使用 JSP 和 HTML 混合编程，精通HTML语法是重要的。所以，你必须能流利地写 HTML 。 <br>　　训练时间：2 ～ 4 个星期。 <br><br>　　３、开始学习 Java 。 <br>　　开始学习 Java 1.4 理解 Java 基础是很重要的。不用担心学习Swing或 Java 的图形方面，因为在JSP 中你不会使用这些特征。集中精力 在 Java 工作的细节，学习 Java 的逻辑，也在 Java Bean上花时间。学习Applet是好的, 但是就象Swing， JSP 的大多数应用将不使用小程 序。 <br>　　训练时间：3 ～ 6 个星期。 <br><br>　　4、学习 JavaScript <br>　　学习怎么将 JavaScript在HTML中验证输入的Form元素。也学习 JavaScript怎么能在一 HTML 页以内修改Form的元素。最后要求你能从一HTML 页内的事件中触发 JavaScript Function。 <br>　　训练时间：一～ 2 个星期。 <br><br>　　5、学习并且理解你的Web Server的更好的细节。 <br>　　熟悉Web Server的特征，这是很重要的。 <br>　　训练时间：2 天。 <br><br>　　6、建立你的 JSP Server <br>　　我推荐以Tomcat开始。它可以很好地运行JSP程序。当你不能在生产使用Tomcat时，学习尽可能多的知识以便于更好的运行程序。另外, 许多 JSP 程序员使用Tomcat。因此当你遇到一个问题时，你将容易发现帮助。 <br>　　安装时间：1～ 2 天。 <br><br>　　7、开始学习 JSP 。 <br>　　基本的 JSP 学习通过的步骤 1到步骤6可以完成, 然后使用 JSP 对象和脚本写 JSP 程序来联系。学习 JSP 的另外一个方面可以学习怎么创建一个分布式的应用程序。 <br>　　训练时间：4 ～ 6 个星期。 <br><br>　　8、学习更多的 JSP server。 <br>　　没有关于更多的 JSP Server当然也可以运行jsp程序。然而, 许多 JSP server都由自己特殊的特征，可以让你更好的理解你的JSP 工程。 <br>　　学习更多的Jsp server如何处理jsp程序是有必要的。同样也可以优化你的 JSP 应用程序，并且使之运行得更快而不出任何问题。 <br>　　训练时间：2 ～ 7 天。 <br><br>　　9、 学习 JDBC 。 <br>　　JSP 大多数应用将使用数据库，JDBC 被用于数据库连接。经常忽略的一个事实就是，每个 JDBC Driver 所支持的东西是相当不同的。了 解并熟悉在jsp工程上被使用的 JDBC driver的细节是很重要的。（有时这部分的学习被包含在前面 Java 或JSP的学习中了 。） <br>　　训练时间：1～ 2 个星期。 <br><br>　　到现在，你已经成为了熟练的 JSP 程序员。仍然有很多需要学习，你可以考虑扩展你的知识比如 DHTML ， XML ，java证书， JSP Tag Libraries 或 Servlets , 看你想要造什么类型的网站而决定了。 <br><br>　　这些训练是JSP 的核心。你不必都学习上面所有的, 取决于你在工程中分配到什么任务和你已经有什么知识。但是这是我成功地训练程序员 的时间表。关键的单元是时间。平均的说, 5 个月时间确实能够训练一个人 ( 从开始到完成 ) 成为一个对jsp熟悉程序员。5 个月时间似乎很长，但要成为一个资深的WEB程序员所学的东西远远不止这一些。 <br><br>　　也许你认为这样学习一种语言花费的时间太长了，因为学 ASP 会更快、时间会更短。 但是学习 ASP 不需要学习java的。 
<img src ="http://www.cnitblog.com/asfman/aggbug/27688.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-05-28 11:05 <a href="http://www.cnitblog.com/asfman/articles/27688.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>几种打开记录集方式的比较</title><link>http://www.cnitblog.com/asfman/articles/27198.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Fri, 18 May 2007 07:22:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/27198.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/27198.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/27198.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/27198.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/27198.html</trackback:ping><description><![CDATA[看：<a href="http://www.jenfy.cn/article/htmldata/list/1/1.html">http://www.jenfy.cn/article/htmldata/list/1/1.html</a><br>几种打开记录集方式的比较<br>　　<br>　　先定义conn.asp<br>　　&lt;%<br>　　 dim objConn<br>　　 dim strConn<br>　　 strConn = &#8220;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8220; &amp; chr(34) &amp; Server.MapPath(&#8220;data.mdb&#8220;) &amp; chr(34) <br>set objConn = server.createobject(&#8220;adodb.connection&#8220;)<br>　　 objConn.open strConn <br>　　%&gt;<br>　　<br>　　再来看一看几种不同打开记录集(recordset)的方式<br>　　<br>　　方式1、<br>　　 dim sql<br>　　 dim objRs<br>　　<br>　　 sql = &#8220;select * from table1&#8220;<br>　　 set objRs = objConn.execute( sql )<br>　　<br>　　这种方式通过执行sql，返回后得到记录集，比较简单地得到经过筛选过的记录集，<br>　　但是通过这种方式得到的记录集，不能进行分页显示。<br>　　<br>　　文件text1.asp<br>　　<br>　　&lt;%@LANGUAGE=&#8220;VBSCRIPT&#8220; CODEPAGE=&#8220;936&#8220;%&gt;<br>　　&lt;!-- #include file=&#8220;conn.asp&#8220; --&gt;<br>　　<br>　　&lt;%<br>　　 dim sql<br>　　 dim objRs<br>　　 <br>　　 sql = &#8220;select * from table1&#8220;<br>　　 set objRs = objConn.execute( sql )<br>　　 <br>　　 objRs.pagesize = 5<br>　　 objRs.absolutepage = 1<br>　　%&gt;<br>　　<br>　　请求该页面得到的结果是:<br>　　<br>　　------------------------------------------------------------<br>　　错误类型：<br>　　ADODB.Recordset (0x800A0CB3)<br>　　当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制。<br>　　/msg/test1.asp, 第 12 行<br>　　<br>　　<br>　　浏览器类型：<br>　　Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) <br>　　<br>　　网页：<br>　　GET /msg/test1.asp <br>　　<br>　　时间：<br>　　2005年9月21日, 19:58:01 <br>　　------------------------------------------------------------<br>　　<br>　　方式2、<br>　　 dim objRs<br>　　 set objRs = Server.CreateObject( &#8220;ADODB.Recordset&#8220; )<br>　　 objRs.open &#8220;table1&#8220; , objConn , 1 , 2<br>　　<br>　　用这种方式打开的记录可以进行分页显示。<br>　　<br>　　&lt;%<br>　　 dim objRs<br>　　 <br>　　 set objRs = Server.CreateObject( &#8220;ADODB.Recordset&#8220; )<br>　　 objRs.open &#8220;table1&#8220; , objConn , 1 , 2<br>　　 <br>　　 objRs.pagesize = 5<br>　　 objRs.absolutepage = 1<br>　　%&gt; <br>　　<br>　　用这个试试，哈哈，顺利运行。<br>　　<br>　　但这种方式打开的记录集不能排序<br>　　<br>　　文件test2.asp<br>　　<br>　　&lt;%@LANGUAGE=&#8220;VBSCRIPT&#8220; CODEPAGE=&#8220;936&#8220;%&gt;<br>　　&lt;!-- #include file=&#8220;conn.asp&#8220; --&gt;<br>　　&lt;%<br>　　 dim objRs<br>　　 <br>　　 set objRs = Server.CreateObject( &#8220;ADODB.Recordset&#8220; )<br>　　 objRs.open &#8220;table1&#8220; , objConn , 1 , 2<br>　　 <br>　　 objRs.sort = &#8220;field1&#8220;<br>　　%&gt;<br>　　<br>　　请求该页面得到的结果是:<br>　　<br>　　------------------------------------------------------------<br>　　错误类型：<br>　　ADODB.Recordset (0x800A0CB3)<br>　　当前提供程序不支持排序或过滤所必需的界面。<br>　　/msg/test2.asp, 第 17 行<br>　　<br>　　<br>　　浏览器类型：<br>　　Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) <br>　　<br>　　网页：<br>　　GET /msg/test2.asp <br>　　<br>　　时间：<br>　　2005年9月21日, 20:17:32 <br>　　------------------------------------------------------------<br>　　<br>　　怎办呢？<br>　　<br>　　哈，这样就行啦。<br>　　 <br>　　&lt;%@LANGUAGE=&#8220;VBSCRIPT&#8220; CODEPAGE=&#8220;936&#8220;%&gt;<br>　　&lt;!-- #include file=&#8220;conn.asp&#8220; --&gt;<br>　　&lt;%<br>　　 dim objRs<br>　　<br>　　 set objRs = Server.CreateObject( &#8220;ADODB.Recordset&#8220; )<br>　　 objRs.CursorLocation = 3<br>　　 objRs.open &#8220;table1&#8220; , objConn , 1 , 2<br>　　 <br>　　 objRs.sort = &#8220;field1 desc&#8220;<br>　　%&gt;<br>　　<br>　　总结一下：<br>　　 1、方式1，可以通过sql语句，方便地筛选你想要的记录。<br>　　 2、方式2，功能比较强大，但比较复杂。<br>　　 这种方式还有更有用的用法。详见其它参考资料。 
<img src ="http://www.cnitblog.com/asfman/aggbug/27198.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-05-18 15:22 <a href="http://www.cnitblog.com/asfman/articles/27198.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js asp</title><link>http://www.cnitblog.com/asfman/articles/27196.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Fri, 18 May 2007 06:36:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/27196.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/27196.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/27196.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/27196.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/27196.html</trackback:ping><description><![CDATA[论坛里面有不少人在使用Javascrīpt编写<a onclick="javascript:tagshow(event, 'Asp');" href="javascript:;" target=_self><u><strong><font color=#000066>Asp</font></strong></u></a>，经常有人在论坛提问，为什么Asp对象在对比指定值时返回结果不对？现在在这里给大家写点关于使用Javascrīpt编写Asp一些需要注意的地方。<br>最常见的问题：[php]Response.Write(Request.Form("Key") == "")[/php]返回的结果怎么都是"False"。在这里，我们使用typeof就可以发现：Request.Form("Key")返回的其实是一个object类型对象，而不是最终的值。所以，我们需要取出最终的值才能够做出正确的判断。可以使用如下解决方法：[php]var Nothing;&nbsp; &nbsp; &nbsp; &nbsp; // 兼容不存在undefined的老版本jscrīpt<br>Response.Write(Request.Form("Key").Item == Nothing);<br>Response.Write(Request.Form("Key").Item === Nothing);<br>// IE 5.5 之后undefined已经是一个常量，可直接访问（Jscrīpt版本是跟随IE升级的）<br>Response.Write(Request.Form("Key").Item == undefined);<br>Response.Write(Request.Form("Key").Item === undefined);<br>Response.Write(Request.Form("Key").Item == null);[/php]所以，取值时我们如果使用完整的取值方式，就不会出现那些奇怪的现象。<br><br>下面说一些Asp中取值的例子：
<p style="FONT-WEIGHT: bold; MARGIN: 1em 1em 0px">QUOTE:</p>
<blockquote style="BORDER-RIGHT: #ddd 1px dotted; PADDING-RIGHT: 0.5em; BORDER-TOP: #ddd 1px dotted; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; MARGIN: 0px 1em 1em; BORDER-LEFT: #ddd 1px dotted; LINE-HEIGHT: 1.8em; PADDING-TOP: 0.5em; BORDER-BOTTOM: #ddd 1px dotted">例：Request.Form("Key")<br>取值：Request.Form.Item("Key").Item<br>或：Request.Form("Key").Item</blockquote>注意这里的Request.Form.Item，直接当属性访问时返回的是一个字符串对象（值类型），作为一个js的&#8220;function&#8221;使用时返回的是一个object。<br>Request.Cookies、Request.QueryString、Request.ServerVariables的取值写法同上。<br>vbs中的简写Request("Key")在javascrīpt中，对应的是Request.Item("Key")
<p style="FONT-WEIGHT: bold; MARGIN: 1em 1em 0px">QUOTE:</p>
<blockquote style="BORDER-RIGHT: #ddd 1px dotted; PADDING-RIGHT: 0.5em; BORDER-TOP: #ddd 1px dotted; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; MARGIN: 0px 1em 1em; BORDER-LEFT: #ddd 1px dotted; LINE-HEIGHT: 1.8em; PADDING-TOP: 0.5em; BORDER-BOTTOM: #ddd 1px dotted">例：rs("FiledName")<br>取值：rs.Fields.Item("FiledName").Value<br>或：rs.Fields("FiledName").Value<br>或：rs("FiledName").Value</blockquote>下面说一下Session和Application。<br>我们常用的Session("Key")，返回的已经是最终值了，所以这个方法可以放心使用。顺便也提一下，Session的完整写法应该是：<br>Session.Contents.Item("Key")<br>也可以写成<br>Session.Contents("Key")<br>Contents对象好像有点多余，其实并非如此，某些时候我们还是需要用到它的，主要是用于Session的枚举和Session的Remove操作。如：[php]Session.Contents.Remove("Key");<br>Session.Contents.RemoveAll()[/php]Abandon方法不属于Contents，它是直接属于Session的一个方法，使用时需要注意这个。<br>Application同样也存在Contents对象，用法和Session相同。<br><br>下面说一下Js枚举Asp对象。<br>我们有时可能想知道，客户端到底提交了一些什么数据？Application或Session中存在一些什么数据？<br>在js中，我们通常使用for...in方式获取一个对象的所有属性，但是，在Asp中，这个方式对于Asp对象就无能为力了。怎么办呢？这个时候，我们可以使用枚举(Enumerator)来获取：[php]var app = new Enumerator(Application.Contents);<br>var arr = new Array;<br>while(!app.atEnd())<br>{<br>&nbsp; &nbsp; &nbsp; &nbsp; var value = Application.Contents.Item(app.item());<br>&nbsp; &nbsp; &nbsp; &nbsp; if(typeof value == "unknown") value = typeof value;<br>&nbsp; &nbsp; &nbsp; &nbsp; else value += " (" + typeof value + ")";<br>&nbsp; &nbsp; &nbsp; &nbsp; arr.push(app.item() + " : " + value);<br>&nbsp; &nbsp; &nbsp; &nbsp; app.moveNext();<br>}<br>Response.Write(arr.join("&lt;br&gt;"));[/php]就写这些了，希望对刚刚开始学使用js编写asp的朋友们有些帮助。<br>]&lt;%@language="javascript" codepage="936"%&gt;&lt;html&gt;&lt;head&gt;<br>&lt;title&gt;Asp Test&lt;/title&gt;<br>&lt;/head&gt;&lt;body scroll="auto"&gt;<br>&lt;%if (Request.ServerVariables("REQUEST_METHOD").Item == "POST")<br>{<br>&nbsp; &nbsp; &nbsp; &nbsp; var svrInfo = "代码执行成功";<br>&nbsp; &nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eval(Request.Form("Code").Item);<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; catch(err)<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; svrInfo = err.message;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; Response.Write("&lt;div&gt;" + svrInfo + "&lt;/div&gt;");<br>}<br>else<br>{%&gt;&lt;table width="100%" height="100%" style="table-layout:fixed"&gt;<br>&lt;form method="post" target="RunCode"&gt;<br>&lt;tr&gt;&lt;td height="45%"&gt;<br>&lt;textarea rows="15" name="Code" style="width:100%;height:100%"&gt;&lt;/textarea&gt;<br>&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td align="center" height="30"&gt;&lt;input type="submit" /&gt;<br>&lt;/td&gt;&lt;/tr&gt;&lt;/form&gt;<br>&lt;tr&gt;&lt;td&gt;<br>&lt;iframe frameborder="0" width="100%" height="100%" name="RunCode"&gt;&lt;/iframe&gt;<br>&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;<br>&lt;%}%&gt;&lt;/body&gt;&lt;/html&gt;
<img src ="http://www.cnitblog.com/asfman/aggbug/27196.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-05-18 14:36 <a href="http://www.cnitblog.com/asfman/articles/27196.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>page</title><link>http://www.cnitblog.com/asfman/articles/26810.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Thu, 10 May 2007 01:59:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/26810.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/26810.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/26810.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/26810.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/26810.html</trackback:ping><description><![CDATA[page=request.querystring("page") <br>if isnumeric(page) and page&gt;0 then <br>page=int(page) <br>else <br>page=1<br>end if
<img src ="http://www.cnitblog.com/asfman/aggbug/26810.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-05-10 09:59 <a href="http://www.cnitblog.com/asfman/articles/26810.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>操纵Excel</title><link>http://www.cnitblog.com/asfman/articles/22823.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Thu, 08 Feb 2007 05:49:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/22823.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/22823.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/22823.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/22823.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/22823.html</trackback:ping><description><![CDATA[
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">html</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />
		</span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">head</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">title</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">操纵Excel</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">title</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />
		</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">head</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />
		</span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">body</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">h2 </span>
		<span style="COLOR: #ff0000">align</span>
		<span style="COLOR: #0000ff">="center"</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">显示Excel文件示例</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">h2</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">table </span>
		<span style="COLOR: #ff0000">border</span>
		<span style="COLOR: #0000ff">="1"</span>
		<span style="COLOR: #ff0000"> width</span>
		<span style="COLOR: #0000ff">="90%"</span>
		<span style="COLOR: #ff0000"> align</span>
		<span style="COLOR: #0000ff">="center"</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />  </span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">tr </span>
		<span style="COLOR: #ff0000">align</span>
		<span style="COLOR: #0000ff">="center"</span>
		<span style="COLOR: #ff0000"> bgcolor</span>
		<span style="COLOR: #0000ff">="#E6E6E6"</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />   </span>
		<span style="COLOR: #0000ff">&lt;</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">学号</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;&lt;</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">姓名</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;&lt;</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">数学</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;&lt;</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">语文</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;&lt;</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">英语</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;&lt;</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">总分</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">td</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />  </span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">tr</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img id="_260_988_Open_Image" onclick="this.style.display='none'; document.getElementById('_260_988_Open_Text').style.display='none'; document.getElementById('_260_988_Closed_Image').style.display='inline'; document.getElementById('_260_988_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" />
				<img id="_260_988_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_260_988_Closed_Text').style.display='none'; document.getElementById('_260_988_Open_Image').style.display='inline'; document.getElementById('_260_988_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" />  </span>
		<span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span>
		<span id="_260_988_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
		<span id="_260_988_Open_Text">
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">'</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">建立Connection对象</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />
				</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Dim</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> db,rs,strSql<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Set</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> db </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> Server.CreateObject(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ADODB.Connection</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  db.Open </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Driver={Microsoft Excel Driver (*.xls)};Dbq=</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> Server.MapPath(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Mark.xls</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">'</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">打开记录集，表名一定要以"[表名$]"的格式</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />
				</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">  strSql</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Select * From [Sheet1$]</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Set</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">db.Execute(strSql)<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">'</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">循环读取所有行</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />
				</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Do</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">While</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Not</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs.EOF<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;tr align='center'&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">学号</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">姓名</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">数学</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">语文</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">英语</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs(</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">总分</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/td&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   Response.Write </span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;/tr&gt;</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />   rs.MoveNext<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Loop</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> <br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /><br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">'</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">关闭对象</span>
				<span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />
				</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">  rs.Close<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Set</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> rs</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">nothing</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  db.Close<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" />  </span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Set</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> db</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span>
				<span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">Nothing</span>
				<span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">
						<br />
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />  </span>
		</span>
		<span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">table</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />
		</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">body</span>
		<span style="COLOR: #0000ff">&gt;</span>
		<span style="COLOR: #000000">
				<br />
				<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />
		</span>
		<span style="COLOR: #0000ff">&lt;/</span>
		<span style="COLOR: #800000">html</span>
		<span style="COLOR: #0000ff">&gt;</span> <br /><img src ="http://www.cnitblog.com/asfman/aggbug/22823.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-02-08 13:49 <a href="http://www.cnitblog.com/asfman/articles/22823.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>风云的upload纯js组件</title><link>http://www.cnitblog.com/asfman/articles/22203.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 22 Jan 2007 06:05:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/22203.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/22203.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/22203.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/22203.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/22203.html</trackback:ping><description><![CDATA[
		<div class="e">
				<span class="b">
						<strong>
								<font face="Courier New" color="#ff0000"> </font>
						</strong>
				</span>
				<font color="#0000ff">
						<span class="m">&lt;?</span>
						<span class="pi">xml version="1.0" encoding="utf-8" </span>
						<span class="m">?&gt;</span>
				</font>
		</div>
		<div class="e">
				<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
						<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
								<strong>
										<font face="Courier New" color="#ff0000">-</font>
								</strong>
						</a>
						<span class="m">
								<font color="#0000ff">&lt;</font>
						</span>
						<span class="t">
								<font color="#990000">package</font>
						</span>
						<span class="m">
								<font color="#0000ff">&gt;</font>
						</span>
				</div>
				<div>
						<div class="e">
								<span class="b">
										<strong>
												<font face="Courier New" color="#ff0000"> </font>
										</strong>
								</span>
								<font color="#0000ff">
										<span class="m">&lt;?</span>
										<span class="pi">component error="false" debug="false"</span>
										<span class="m">?&gt;</span>
								</font>
						</div>
						<div class="e">
								<div class="c">
										<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
												<strong>
														<font face="Courier New" color="#ff0000">-</font>
												</strong>
										</a>
										<span class="m">
												<font color="#0000ff">&lt;</font>
										</span>
										<span class="t">
												<font color="#990000">comment</font>
										</span>
										<span class="m">
												<font color="#0000ff">&gt;</font>
										</span>
								</div>
								<div>
										<div class="k">
												<span class="c">
														<a class="b" style="VISIBILITY: visible" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																<strong>
																		<font face="Courier New" color="#ff0000">-</font>
																</strong>
														</a>
														<span class="m">
																<font color="#0000ff">&lt;![CDATA[</font>
														</span>
												</span>
												<span class="db" id="" style="DISPLAY: block">
														<pre>	風雲ASP上传组件（纯Javascript的ASP文件上传组件）
	Author: Rimifon
	LastModify: 14:00 2006-11-30
</pre>
												</span>
												<span class="b">
														<strong>
																<font face="Courier New" color="#ff0000"> </font>
														</strong>
												</span>
												<font color="#0000ff">
														<span class="m">]]&gt;</span>
														<script><![CDATA[(clean);]]&gt;</script>
												</font>
										</div>
										<div>
												<span class="b">
														<strong>
																<font face="Courier New" color="#ff0000"> </font>
														</strong>
												</span>
												<span class="m">
														<font color="#0000ff">&lt;/</font>
												</span>
												<span class="t">
														<font color="#990000">comment</font>
												</span>
												<span class="m">
														<font color="#0000ff">&gt;</font>
												</span>
										</div>
								</div>
						</div>
						<div class="e">
								<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
										<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
												<strong>
														<font face="Courier New" color="#ff0000">-</font>
												</strong>
										</a>
										<span class="m">
												<font color="#0000ff">&lt;</font>
										</span>
										<font color="#990000">
												<span class="t">scriptlet</span>
												<span class="t"> id</span>
										</font>
										<span class="m">
												<font color="#0000ff">="</font>
										</span>
										<b>Upload</b>
										<font color="#0000ff">
												<span class="m">"</span>
												<span class="m">&gt;</span>
										</font>
								</div>
								<div>
										<div class="e">
												<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
														<span class="b">
																<strong>
																		<font face="Courier New" color="#ff0000"> </font>
																</strong>
														</span>
														<span class="m">
																<font color="#0000ff">&lt;</font>
														</span>
														<span class="t">
																<font color="#990000">registration</font>
														</span>
														<span class="t">
																<font color="#990000">clsid</font>
														</span>
														<span class="m">
																<font color="#0000ff">="</font>
														</span>
														<b>{12345678-aabb-ccdd-eeff-012345678900}</b>
														<span class="m">
																<font color="#0000ff">"</font>
														</span>
														<span class="t">
																<font color="#990000"> progid</font>
														</span>
														<span class="m">
																<font color="#0000ff">="</font>
														</span>
														<b>Rimifon.Upload</b>
														<span class="m">
																<font color="#0000ff">"</font>
														</span>
														<span class="t">
																<font color="#990000"> version</font>
														</span>
														<span class="m">
																<font color="#0000ff">="</font>
														</span>
														<b>3.3</b>
														<span class="m">
																<font color="#0000ff">"</font>
														</span>
														<span class="t">
																<font color="#990000"> description</font>
														</span>
														<span class="m">
																<font color="#0000ff">="</font>
														</span>
														<b>風雲ASP上传组件</b>
														<font color="#0000ff">
																<span class="m">"</span>
																<span class="m"> /&gt;</span>
														</font>
												</div>
										</div>
										<div class="e">
												<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
														<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																<strong>
																		<font face="Courier New" color="#ff0000">-</font>
																</strong>
														</a>
														<span class="m">
																<font color="#0000ff">&lt;</font>
														</span>
														<span class="t">
																<font color="#990000">public</font>
														</span>
														<span class="m">
																<font color="#0000ff">&gt;</font>
														</span>
												</div>
												<div>
														<div class="e">
																<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																				<strong>
																						<font face="Courier New" color="#ff0000">-</font>
																				</strong>
																		</a>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<font color="#990000">
																				<span class="t">property</span>
																				<span class="t"> name</span>
																		</font>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>Name</b>
																		<span class="m">
																				<font color="#0000ff">"</font>
																		</span>
																		<span class="t">
																				<font color="#990000"> dispid</font>
																		</span>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>0</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m">&gt;</span>
																		</font>
																</div>
																<div>
																		<div class="e">
																				<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																						<span class="b">
																								<strong>
																										<font face="Courier New" color="#ff0000"> </font>
																								</strong>
																						</span>
																						<span class="m">
																								<font color="#0000ff">&lt;</font>
																						</span>
																						<span class="t">
																								<font color="#990000">get</font>
																						</span>
																						<span class="t">
																								<font color="#990000">internalName</font>
																						</span>
																						<span class="m">
																								<font color="#0000ff">="</font>
																						</span>
																						<b>ProductName</b>
																						<font color="#0000ff">
																								<span class="m">"</span>
																								<span class="m"> /&gt;</span>
																						</font>
																				</div>
																		</div>
																		<div>
																				<span class="b">
																						<strong>
																								<font face="Courier New" color="#ff0000"> </font>
																						</strong>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&lt;/</font>
																				</span>
																				<span class="t">
																						<font color="#990000">property</font>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&gt;</font>
																				</span>
																		</div>
																</div>
														</div>
														<div class="e">
																<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<span class="b">
																				<strong>
																						<font face="Courier New" color="#ff0000"> </font>
																				</strong>
																		</span>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<span class="t">
																				<font color="#990000">property</font>
																		</span>
																		<span class="t">
																				<font color="#990000">name</font>
																		</span>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>Filter</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m"> /&gt;</span>
																		</font>
																</div>
														</div>
														<div class="e">
																<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<span class="b">
																				<strong>
																						<font face="Courier New" color="#ff0000"> </font>
																				</strong>
																		</span>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<span class="t">
																				<font color="#990000">property</font>
																		</span>
																		<span class="t">
																				<font color="#990000">name</font>
																		</span>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>MaxSize</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m"> /&gt;</span>
																		</font>
																</div>
														</div>
														<div class="e">
																<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<span class="b">
																				<strong>
																						<font face="Courier New" color="#ff0000"> </font>
																				</strong>
																		</span>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<span class="t">
																				<font color="#990000">property</font>
																		</span>
																		<span class="t">
																				<font color="#990000">name</font>
																		</span>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>Field</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m"> /&gt;</span>
																		</font>
																</div>
														</div>
														<div class="e">
																<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<span class="b">
																				<strong>
																						<font face="Courier New" color="#ff0000"> </font>
																				</strong>
																		</span>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<span class="t">
																				<font color="#990000">property</font>
																		</span>
																		<span class="t">
																				<font color="#990000">name</font>
																		</span>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>Charset</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m"> /&gt;</span>
																		</font>
																</div>
														</div>
														<div class="e">
																<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																				<strong>
																						<font face="Courier New" color="#ff0000">-</font>
																				</strong>
																		</a>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<font color="#990000">
																				<span class="t">method</span>
																				<span class="t"> name</span>
																		</font>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>ReadForm</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m">&gt;</span>
																		</font>
																</div>
																<div>
																		<div class="e">
																				<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																						<span class="b">
																								<strong>
																										<font face="Courier New" color="#ff0000"> </font>
																								</strong>
																						</span>
																						<span class="m">
																								<font color="#0000ff">&lt;</font>
																						</span>
																						<span class="t">
																								<font color="#990000">parameter</font>
																						</span>
																						<span class="t">
																								<font color="#990000">name</font>
																						</span>
																						<span class="m">
																								<font color="#0000ff">="</font>
																						</span>
																						<b>ReadSize</b>
																						<font color="#0000ff">
																								<span class="m">"</span>
																								<span class="m"> /&gt;</span>
																						</font>
																				</div>
																		</div>
																		<div class="e">
																				<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																						<span class="b">
																								<strong>
																										<font face="Courier New" color="#ff0000"> </font>
																								</strong>
																						</span>
																						<span class="m">
																								<font color="#0000ff">&lt;</font>
																						</span>
																						<span class="t">
																								<font color="#990000">parameter</font>
																						</span>
																						<span class="t">
																								<font color="#990000">name</font>
																						</span>
																						<span class="m">
																								<font color="#0000ff">="</font>
																						</span>
																						<b>ProgID</b>
																						<font color="#0000ff">
																								<span class="m">"</span>
																								<span class="m"> /&gt;</span>
																						</font>
																				</div>
																		</div>
																		<div>
																				<span class="b">
																						<strong>
																								<font face="Courier New" color="#ff0000"> </font>
																						</strong>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&lt;/</font>
																				</span>
																				<span class="t">
																						<font color="#990000">method</font>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&gt;</font>
																				</span>
																		</div>
																</div>
														</div>
														<div class="e">
																<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																				<strong>
																						<font face="Courier New" color="#ff0000">-</font>
																				</strong>
																		</a>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<font color="#990000">
																				<span class="t">method</span>
																				<span class="t"> name</span>
																		</font>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>SaveFile</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m">&gt;</span>
																		</font>
																</div>
																<div>
																		<div class="e">
																				<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																						<span class="b">
																								<strong>
																										<font face="Courier New" color="#ff0000"> </font>
																								</strong>
																						</span>
																						<span class="m">
																								<font color="#0000ff">&lt;</font>
																						</span>
																						<span class="t">
																								<font color="#990000">parameter</font>
																						</span>
																						<span class="t">
																								<font color="#990000">name</font>
																						</span>
																						<span class="m">
																								<font color="#0000ff">="</font>
																						</span>
																						<b>SavePath</b>
																						<font color="#0000ff">
																								<span class="m">"</span>
																								<span class="m"> /&gt;</span>
																						</font>
																				</div>
																		</div>
																		<div>
																				<span class="b">
																						<strong>
																								<font face="Courier New" color="#ff0000"> </font>
																						</strong>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&lt;/</font>
																				</span>
																				<span class="t">
																						<font color="#990000">method</font>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&gt;</font>
																				</span>
																		</div>
																</div>
														</div>
														<div class="e">
																<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																				<strong>
																						<font face="Courier New" color="#ff0000">-</font>
																				</strong>
																		</a>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<font color="#990000">
																				<span class="t">method</span>
																				<span class="t"> name</span>
																		</font>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>AspTest</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m">&gt;</span>
																		</font>
																</div>
																<div>
																		<div class="e">
																				<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																						<span class="b">
																								<strong>
																										<font face="Courier New" color="#ff0000"> </font>
																								</strong>
																						</span>
																						<span class="m">
																								<font color="#0000ff">&lt;</font>
																						</span>
																						<span class="t">
																								<font color="#990000">parameter</font>
																						</span>
																						<span class="t">
																								<font color="#990000">name</font>
																						</span>
																						<span class="m">
																								<font color="#0000ff">="</font>
																						</span>
																						<b>Sender</b>
																						<font color="#0000ff">
																								<span class="m">"</span>
																								<span class="m"> /&gt;</span>
																						</font>
																				</div>
																		</div>
																		<div>
																				<span class="b">
																						<strong>
																								<font face="Courier New" color="#ff0000"> </font>
																						</strong>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&lt;/</font>
																				</span>
																				<span class="t">
																						<font color="#990000">method</font>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&gt;</font>
																				</span>
																		</div>
																</div>
														</div>
														<div class="e">
																<div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																				<strong>
																						<font face="Courier New" color="#ff0000">-</font>
																				</strong>
																		</a>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<font color="#990000">
																				<span class="t">method</span>
																				<span class="t"> name</span>
																		</font>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>Form</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m">&gt;</span>
																		</font>
																</div>
																<div>
																		<div class="e">
																				<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																						<span class="b">
																								<strong>
																										<font face="Courier New" color="#ff0000"> </font>
																								</strong>
																						</span>
																						<span class="m">
																								<font color="#0000ff">&lt;</font>
																						</span>
																						<span class="t">
																								<font color="#990000">parameter</font>
																						</span>
																						<span class="t">
																								<font color="#990000">name</font>
																						</span>
																						<span class="m">
																								<font color="#0000ff">="</font>
																						</span>
																						<b>Element</b>
																						<font color="#0000ff">
																								<span class="m">"</span>
																								<span class="m"> /&gt;</span>
																						</font>
																				</div>
																		</div>
																		<div>
																				<span class="b">
																						<strong>
																								<font face="Courier New" color="#ff0000"> </font>
																						</strong>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&lt;/</font>
																				</span>
																				<span class="t">
																						<font color="#990000">method</font>
																				</span>
																				<span class="m">
																						<font color="#0000ff">&gt;</font>
																				</span>
																		</div>
																</div>
														</div>
														<div class="e">
																<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
																		<span class="b">
																				<strong>
																						<font face="Courier New" color="#ff0000"> </font>
																				</strong>
																		</span>
																		<span class="m">
																				<font color="#0000ff">&lt;</font>
																		</span>
																		<span class="t">
																				<font color="#990000">method</font>
																		</span>
																		<span class="t">
																				<font color="#990000">name</font>
																		</span>
																		<span class="m">
																				<font color="#0000ff">="</font>
																		</span>
																		<b>Dispose</b>
																		<font color="#0000ff">
																				<span class="m">"</span>
																				<span class="m"> /&gt;</span>
																		</font>
																</div>
														</div>
														<div>
																<span class="b">
																		<strong>
																				<font face="Courier New" color="#ff0000"> </font>
																		</strong>
																</span>
																<span class="m">
																		<font color="#0000ff">&lt;/</font>
																</span>
																<span class="t">
																		<font color="#990000">public</font>
																</span>
																<span class="m">
																		<font color="#0000ff">&gt;</font>
																</span>
														</div>
												</div>
										</div>
										<div class="e">
												<div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
														<span class="b">
																<strong>
																		<font face="Courier New" color="#ff0000"> </font>
																</strong>
														</span>
														<span class="m">
																<font color="#0000ff">&lt;</font>
														</span>
														<span class="t">
																<font color="#990000">implements</font>
														</span>
														<span class="t">
																<font color="#990000">type</font>
														</span>
														<span class="m">
																<font color="#0000ff">="</font>
														</span>
														<b>ASP</b>
														<font color="#0000ff">
																<span class="m">"</span>
																<span class="m"> /&gt;</span>
														</font>
												</div>
										</div>
										<div class="e">
												<div class="c">
														<a class="b" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																<strong>
																		<font face="Courier New" color="#ff0000">-</font>
																</strong>
														</a>
														<span class="m">
																<font color="#0000ff">&lt;</font>
														</span>
														<font color="#990000">
																<span class="t">script</span>
																<span class="t"> language</span>
														</font>
														<span class="m">
																<font color="#0000ff">="</font>
														</span>
														<b>Javascript</b>
														<font color="#0000ff">
																<span class="m">"</span>
																<span class="m">&gt;</span>
														</font>
												</div>
												<div>
														<div class="k">
																<span class="c">
																		<a class="b" style="VISIBILITY: visible" onfocus="h()" onclick="return false" href="http://www.zope.org/Members/Rimifon/FyUpload.sct#">
																				<strong>
																						<font face="Courier New" color="#ff0000">-</font>
																				</strong>
																		</a>
																		<span class="m">
																				<font color="#0000ff">&lt;![CDATA[</font>
																		</span>
																</span>
																<span class="db" id="" style="DISPLAY: block">
																		<pre>var AspOnly = "本组件仅用于ASP页面。";
var Charset = "gb2312";
var Rule, Field, Stream, Nothing;
var GetFileBody = MaxSize = 0;
var TempField = LastData = "";
var Filter = "rar|zip|txt|gif|jpg|bmp|htm|html|swf|mht";
function ProductName()
{
	return "風雲ASP上传组件";
}
function ReadForm(ReadSize, ProgID)
{
	Field = new Array;
	if(!this.Server) return AspOnly;
	Rule = Request.ServerVariables("Http_Content_Type").Item;
	if(!Rule || Rule.indexOf("multipart/form-data")) return TextForm();
	Rule = "--" + Rule.split("=")[1];
	Rule = Rule.replace(/[\x00-\xff]/g,
		function($1)
		{
			return "%" + $1.charCodeAt(0).toString(16).toUpperCase();
		});
	var TotalBytes = Request.TotalBytes;
	if(ReadSize % 2) ReadSize += 1;
	if(!ReadSize || ReadSize &gt; TotalBytes) ReadSize = TotalBytes;
	var ReadBytes = 0;
	if(!Stream)Stream = Server.CreateObject("Adodb.Stream");
	while(ReadBytes &lt; TotalBytes &amp;&amp; Response.IsClientConnected())
	{
		ReadBytes += ReadSize;
		if(ReadBytes &gt; TotalBytes)
		{
			ReadSize = ReadSize + TotalBytes - ReadBytes;
			ReadBytes = TotalBytes;
		}
		if(ProgID)
		{
			Application.Lock();
			Application.Contents(ProgID + "_TotalBytes") = TotalBytes;
			Application.Contents(ProgID + "_ReadBytes") = ReadBytes;
			Application.Unlock();
		}
		LastData += EncodeChar(BinToStr(Request.BinaryRead(ReadSize)));
		if(LastData.length &lt; Rule.length) continue;
		if(!GetFileBody &amp;&amp; LastData.indexOf(Rule) &gt; -1)
		{
			GetFullData();
		}
		else
		{
			if(!GetFileBody &amp;&amp; LastData.indexOf("%0D%0A%0D%0A") &gt; 0)
			{

				var fieldBody = unescape(LastData.replace(/%(\w{2})%(\w{2})/g, "%u$2$1"));
				fieldBody = BinToStr(fieldBody, Charset).split("\r\n\r\n")[0];
				var mimeType = fieldBody.match(/Type: (.*)$/);
				if(mimeType)
				{
					var filePath = fieldBody.match(/ filename="(.*?)"/);
					TempField = fieldBody.match(/ name="(.*?)"/)[1];
					Field[TempField] = new FormField;
					Field[TempField].FileType = mimeType[1];
					Field[TempField].FilePath = filePath[1];
					Field[TempField].SourceName = filePath[1].match(/([^\/\\]*?)$/)[1];
					Field[TempField].FileSize = 0;
					LastData = LastData.replace(/^(.*?)%0D%0A%0D%0A/,"");
					Field[TempField].Value = new Array;
					GetFileBody = 1;
				}
			}
			else if(GetFileBody)
			{
				if(LastData.length &lt; Rule.length + 6) continue;
				if(LastData.indexOf("%0D%0A" + Rule) &lt; 0)
				{
					var uniChar = LastData.slice(0, 0 - Rule.length - 6);
					if(uniChar.length % 6) uniChar = uniChar.slice(0, -3);
					Field[TempField].FileSize += uniChar.length;
					if(!MaxSize || Field[TempField].FileSize/3 &lt;= MaxSize)
						Field[TempField].Value.push(unescape(uniChar.replace(/%(\w{2})%(\w{2})/g,"%u$2$1")));
					LastData = LastData.replace(uniChar, "");
				}
				else
				{
					var uniChar = LastData.split("%0D%0A" + Rule)[0];
					Field[TempField].FileSize += uniChar.length;
					LastData = LastData.replace(uniChar, "");
					if(!MaxSize || Field[TempField].FileSize/3 &lt;= MaxSize)
					{
						Field[TempField].Value.push(unescape(uniChar.replace(/%(\w{2})%(\w{2})/g,"%u$2$1")));
						Field[TempField].Value = Field[TempField].Value.join("");
					}
					else
					{
						Field[TempField].Value = "文件太大";
					}
					Field[TempField].FileSize = Field[TempField].FileSize / 3;
					GetFileBody = 0;
					if(LastData.length &gt; Rule.length &amp;&amp; ReadBytes == TotalBytes) GetFullData();
				}
			}
		}
	}
}
function SaveFile(SavePath)
{
	if(!this.Server) return AspOnly;
	SavePath = SavePath?SavePath.replace(/[\/\\]$/,""):".";
	var upFilter = new RegExp("\\.(" + Filter + ")$","i");
	for(var i in Field)
	{
		if(Field[i].FilePath)
		{
			if(!Field[i].Value)
			{
				Field[i].Message = "文件内容不能为空";
				continue;
			}
			if(Filter &amp;&amp; !Field[i].FilePath.match(upFilter))
			{
				Field[i].Message = "服务器不接受该类文档";
				continue;
			}
			if(MaxSize &amp;&amp; Field[i].FileSize &gt; MaxSize)
			{
				Field[i].Message = "上传文档大小超过限制";
				continue;
			}
			var filename = Field[i].SavePath;
			if(!filename)
			{
				var fileExt = Field[i].FilePath.match(/\.([^\/\.\\]*)$/);
				filename = MakeFileName() + (fileExt?fileExt[0]:"");
				Field[i].FileName = filename;
				filename = Server.MapPath(SavePath + "\\" + filename);
			}
			Stream.Type = 2;
			Stream.Open();
			Stream.Charset = "unicode";
			Stream.WriteText(Field[i].Value);
			try
			{
				Stream.SaveToFile(filename);
			}
			catch(err)
			{
				Field[i].Message = err.message;
				continue;
			}
			finally
			{
				Stream.Close();
			}
			if(!Field[i].SavePath) Field[i].SavePath = filename;
			Stream.Type = 1;
			Stream.Open();
			Stream.LoadFromFile(filename);
			Stream.Position = 2;
			var file = Stream.Read(Field[i].FileSize);
			Stream.Position = 0;
			Stream.SetEOS();
			Stream.Write(file);
			Stream.SaveToFile(filename, 2);
			Stream.Close();
		}
	}	
}
function GetFullData()
{
	LastData = LastData.split(Rule);
	for(var C=0; C&lt;LastData.length-1; C++)
	{
		if(LastData[C].length &lt; 10) continue;
		var strField = ParseData(LastData[C]);
		Field[strField[0]] = new FormField;
		Field[strField[0]].Value = strField[1];
		if(strField[3])
		{
			Field[strField[0]].FilePath = strField[2];
			Field[strField[0]].SourceName = strField[2].match(/([^\/\\]*?)$/)[1];
			Field[strField[0]].FileType = strField[3];
			var fileInfo = GetFile(LastData[C]);
			Field[strField[0]].Value = fileInfo[0];
			Field[strField[0]].FileSize = fileInfo[1];
		}
	}
	LastData = LastData.pop();
}
function BinToStr(uniChar, encoding)
{
	Stream.Open();
	Stream.Charset = "unicode";
	Stream.WriteText(uniChar);
	Stream.Position = 0;
	if(encoding &amp;&amp; encoding != "unicode") Stream.Charset = encoding;
	uniChar = Stream.ReadText();
	Stream.Close();
	return uniChar;
}
function EncodeChar(uniChar)
{
	uniChar = uniChar.replace(/[\x00-\xff]/g,
		function($1)
		{
			$1=$1.charCodeAt(0).toString(16).toUpperCase();
			if($1.length &lt; 2) $1 = "0" + $1;
			return "_00" + $1;
		});
	return escape(uniChar).replace(/_/g,"%u").replace(/%u(\w{2})(\w{2})/g,"%$2%$1");
}
function ParseData(uniChar)
{
	var fieldBody, fieldName, fieldValue, filePath, mimeType;
	uniChar = unescape(uniChar.replace(/%(\w{2})%(\w{2})/g, "%u$2$1"));
	uniChar = BinToStr(uniChar, Charset);
	fieldBody = uniChar.split("\r\n\r\n");
	fieldName = fieldBody[0].match(/ name="(.*?)"/)[1];
	mimeType = fieldBody[0].match(/Type: (.*)$/);
	filePath = fieldBody[0].match(/ filename="(.*?)"/);
	fieldBody.shift();
	fieldValue = fieldBody.join("\r\n\r\n").replace(/\r\n(\x00)?$/,"");
	return [fieldName, fieldValue, filePath?filePath[1]:Nothing, mimeType?mimeType[1]:Nothing];
}
function GetFile(uniChar)
{
	uniChar = uniChar.slice(0,-6).replace(/(.*?)(%0D%0A){2}/,"");
	var fileSize = uniChar.length / 3;
	uniChar = unescape(uniChar.replace(/%(\w{2})%(\w{2})/g,"%u$2$1"));
	return [uniChar, fileSize];
}
function MakeFileName()
{
	var time = new Date;
	var arrName = new Array;
	arrName.push(time.getYear().toString().substr(2,2));
	arrName.push(time.getMonth()+1);
	arrName.push(time.getDate());
	arrName.push(time.getHours());
	arrName.push(time.getMinutes());
	arrName.push(time.getSeconds());
	arrName.push(Math.random().toString().substr(2,4));
	return arrName.join("!").replace(/!(\d+)/g,function($0,$1){return $1&gt;9?$1:"0"+$1});
}
function TextForm()
{
	TempField = new Enumerator(Request.Form);
	while(!TempField.atEnd())
	{
		Field[TempField.item()] = new FormField;
		Field[TempField.item()].Value = Request.Form(TempField.item()).Item;
		TempField.moveNext();
	}
}
function FormField()
{
	this.FileName = Nothing;
	this.FileType = Nothing;
	this.FilePath = Nothing;
	this.FileSize = Nothing;
	this.SavePath = Nothing;
	this.SourceName = Nothing;
	this.Message = Nothing;
	this.Value = Nothing;
}
function Form(Element)
{
	if(Field[Element])
	{
		var field = new String(Field[Element].Value?Field[Element].Value:"");
		field.FileName = Field[Element].FileName;
		field.FileType = Field[Element].FileType;
		field.FilePath = Field[Element].FilePath;
		field.FileSize = Field[Element].FileSize;
		field.SavePath = Field[Element].SavePath;
		field.SourceName = Field[Element].SourceName;
		field.Message = Field[Element].Message;
		field.Value = Field[Element].Value;
		return field;
	}
	else
	{
		return Nothing;
	}
}
function AspTest(Sender)
{
	if(!this.Server &amp;&amp; Sender.Server)
	{
		this.Server = Sender.Server;
		this.Request = Sender.Request;
		this.Response = Sender.Response;
		this.Application = Sender.Application;
	}
}
function Dispose()
{
	Field = Stream = Nothing;
	CollectGarbage();
}
</pre>
																</span>
																<span class="b">
																		<strong>
																				<font face="Courier New" color="#ff0000"> </font>
																		</strong>
																</span>
																<font color="#0000ff">
																		<span class="m">]]&gt;</span>
																		<script><![CDATA[(clean);]]&gt;</script>
																</font>
														</div>
														<div>
																<span class="b">
																		<strong>
																				<font face="Courier New" color="#ff0000"> </font>
																		</strong>
																</span>
																<span class="m">
																		<font color="#0000ff">&lt;/</font>
																</span>
																<span class="t">
																		<font color="#990000">script</font>
																</span>
																<span class="m">
																		<font color="#0000ff">&gt;</font>
																</span>
														</div>
												</div>
										</div>
										<div>
												<span class="b">
														<strong>
																<font face="Courier New" color="#ff0000"> </font>
														</strong>
												</span>
												<span class="m">
														<font color="#0000ff">&lt;/</font>
												</span>
												<span class="t">
														<font color="#990000">scriptlet</font>
												</span>
												<span class="m">
														<font color="#0000ff">&gt;</font>
												</span>
										</div>
								</div>
						</div>
						<div>
								<span class="b">
										<strong>
												<font face="Courier New" color="#ff0000"> </font>
										</strong>
								</span>
								<span class="m">
										<font color="#0000ff">&lt;/</font>
								</span>
								<span class="t">
										<font color="#990000">package</font>
								</span>
								<span class="m">
										<font color="#0000ff">&gt;</font>
								</span>
						</div>
				</div>
		</div>
<img src ="http://www.cnitblog.com/asfman/aggbug/22203.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-01-22 14:05 <a href="http://www.cnitblog.com/asfman/articles/22203.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何优化JavaScript脚本的性能？</title><link>http://www.cnitblog.com/asfman/articles/22183.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 22 Jan 2007 00:44:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/22183.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/22183.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/22183.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/22183.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/22183.html</trackback:ping><description><![CDATA[
		<p>如何优化JavaScript脚本的性能？</p>
		<p>2006年11月18日 星期六 上午 00:05随着网络的发展，网速和机器速度的提高，越来越多的网站用到了丰富客户端技术。而现在Ajax则是最为流行的一种方式。JavaScript是一种解释型语言，所以能无法达到和C/Java之类的水平，限制了它能在客户端所做的事情，为了能改进他的性能，我想基于我以前给JavaScript做过的很多测试来谈谈自己的经验，希望能帮助大家改进自己的JavaScript脚本性能。<br /><br />语言层次方面<br />循环<br />循环是很常用的一个控制结构，大部分东西要依靠它来完成，在JavaScript中，我们可以使用for(;;),while(),for(in)三种循环，事实上，这三种循环中for(in)的效率极差，因为他需要查询散列键，只要可以就应该尽量少用。for(;;)和while循环的性能应该说基本（平时使用时）等价。<br /><br />而事实上，如何使用这两个循环，则有很大讲究。我在测试中有些很有意思的情况，见附录。最后得出的结论是：<br /><br />如果是循环变量递增或递减，不要单独对循环变量赋值，应该在它最后一次读取的时候使用嵌套的++或—操作符。<br /><br />如果要与数组的长度作比较，应该事先把数组的length属性放入一个局部变量中，减少查询次数。<br /><br />局部变量和全局变量<br />局部变量的速度要比全局变量的访问速度更快，因为全局变量其实是全局对象的成员，而局部变量是放在函数的栈当中的。<br /><br />不使用Eval<br />使用eval相当于在运行时再次调用解释引擎对内容进行运行，需要消耗大量时间。这时候使用JavaScript所支持的闭包可以实现函数模版（关于闭包的内容请参考函数式编程的有关内容）<br /><br />减少对象查找<br />因为JavaScript的解释性，所以a.b.c.d.e，需要进行至少4次查询操作，先检查a再检查a中的b，再检查b中的c，如此往下。所以如果这样的表达式重复出现，只要可能，应该尽量少出现这样的表达式，可以利用局部变量，把它放入一个临时的地方进行查询。<br /><br />这一点可以和循环结合起来，因为我们常常要根据字符串、数组的长度进行循环，而通常这个长度是不变的，比如每次查询a.length，就要额外进行一个操作，而预先把var len=a.length，则就少了一次查询。<br /><br />字符串连接<br />如果是追加字符串，最好使用s+=anotherStr操作，而不是要使用s=s+anotherStr。<br /><br />如果要连接多个字符串，应该少使用+=，如<br /><br />s+=a;s+=b;s+=c;<br />应该写成<br /><br />s+=a + b + c；<br />而如果是收集字符串，比如多次对同一个字符串进行+=操作的话，最好使用一个缓存。怎么用呢？使用JavaScript数组来收集，最后使用join方法连接起来，如下<br /><br />var buf = new Array();for(var i = 0; i &lt; 100; i++){ buf.push(i.toString());}var all = buf.join("");<br />类型转换<br />类型转换是大家常犯的错误，因为JavaScript是动态类型语言，你不能指定变量的类型。<br /><br />1. 把数字转换成字符串，应用"" + 1，虽然看起来比较丑一点，但事实上这个效率是最高的，性能上来说：<br /><br />("" +) &gt; String() &gt; .toString() &gt; new String() <br /><br />这条其实和下面的“直接量”有点类似，尽量使用编译时就能使用的内部操作要比运行时使用的用户操作要快。<br /><br />String()属于内部函数，所以速度很快，而.toString()要查询原型中的函数，所以速度逊色一些，new String()用于返回一个精确的副本。<br /><br />2. 浮点数转换成整型，这个更容易出错，很多人喜欢使用parseInt()，其实parseInt()是用于将字符串转换成数字，而不是浮点数和整型之间的转换，我们应该使用Math.floor()或者Math.round()。<br /><br />另外，和第二节的对象查找中的问题不一样，Math是内部对象，所以Math.floor()其实并没有多少查询方法和调用的时间，速度是最快的。<br /><br />3. 对于自定义的对象，如果定义了toString()方法来进行类型转换的话，推荐显式调用toString()，因为内部的操作在尝试所有可能性之后，会尝试对象的toString()方法尝试能否转化为String，所以直接调用这个方法效率会更高<br /><br />使用直接量<br />其实这个影响倒比较小，可以忽略。什么叫使用直接量，比如，JavaScript支持使用[param,param,param,...]来直接表达一个数组，以往我们都使用new Array(param,param,...)，使用前者是引擎直接解释的，后者要调用一个Array内部构造器，所以要略微快一点点。<br /><br />同样，var foo = {}的方式也比var foo = new Object();快，var reg = /../;要比var reg=new RegExp()快。<br /><br />字符串遍历操作<br />对字符串进行循环操作，譬如替换、查找，应使用正则表达式，因为本身JavaScript的循环速度就比较慢，而正则表达式的操作是用C写成的语言的API，性能很好。<br /><br />高级对象<br />自定义高级对象和Date、RegExp对象在构造时都会消耗大量时间。如果可以复用，应采用缓存的方式。<br /><br />DOM相关<br />插入HTML<br />很多人喜欢在JavaScript中使用document.write来给页面生成内容。事实上这样的效率较低，如果需要直接插入HTML，可以找一个容器元素，比如指定一个div或者span，并设置他们的innerHTML来将自己的HTML代码插入到页面中。<br /><br />对象查询<br />使用[“”]查询要比.items()更快，这和前面的减少对象查找的思路是一样的，调用.items()增加了一次查询和函数的调用。<br /><br />创建DOM节点<br />通常我们可能会使用字符串直接写HTML来创建节点，其实这样做<br /><br />无法保证代码的有效性<br /><br />字符串操作效率低<br /><br />所以应该是用document.createElement()方法，而如果文档中存在现成的样板节点，应该是用cloneNode()方法，因为使用createElement()方法之后，你需要设置多次元素的属性，使用cloneNode()则可以减少属性的设置次数——同样如果需要创建很多元素，应该先准备一个样板节点。<br /><br />定时器<br />如果针对的是不断运行的代码，不应该使用setTimeout，而应该是用setInterval。setTimeout每次要重新设置一个定时器。<br /><br />其他<br />脚本引擎<br />据我测试Microsoft的JScript的效率较Mozilla的Spidermonkey要差很多，无论是执行速度还是内存管理上，因为JScript现在基本也不更新了。但SpiderMonkey不能使用ActiveXObject<br /><br />文件优化<br />文件优化也是一个很有效的手段，删除所有的空格和注释，把代码放入一行内，可以加快下载的速度，注意，是下载的速度而不是解析的速度，如果是本地，注释和空格并不会影响解释和执行速度。<br /><br />总结<br />本文总结了我在JavaScript编程中所找到的提高JavaScript运行性能的一些方法，其实这些经验都基于几条原则：<br /><br />直接拿手头现成的东西比较快，如局部变量比全局变量快，直接量比运行时构造对象快等等。<br /><br />尽可能少地减少执行次数，比如先缓存需要多次查询的。<br /><br />尽可能使用语言内置的功能，比如串链接。<br /><br />尽可能使用系统提供的API，因为这些API是编译好的二进制代码，执行效率很高<br /><br />同时，一些基本的算法上的优化，同样可以用在JavaScript中，比如运算结构的调整，这里就不再赘述了。但是由于JavaScript是解释型的，一般不会在运行时对字节码进行优化，所以这些优化仍然是很重要的。<br /><br />当然，其实这里的一些技巧同样使用在其他的一些解释型语言中，大家也可以进行参考。<br /><br />参考<br />http://www.umsu.de/jsperf/ 各种浏览器的测试对比<br /><br />http://home.earthlink.net/~kendrasg/info/js_opt/ <br /><br />附录1<br />由于是以前做过的测试，测试代码已经不全，我补充了一部分如下：<br /><br />var print;<br /><br />if(typeof document != "undefined" ){<br />    print = function(){<br />  document.write(arguments[0]);<br /> }<br />}else if(typeof WScript != "undefined" ){<br />    print = function(){<br />        WScript.Echo(arguments[0],arguments[1],arguments[2]);<br />    }<br />}<br /><br />function empty(){<br />}<br /><br />function benchmark(f){<br />    var i = 0;<br />    var start = (new Date()).getTime();<br /> <br />    while(i &lt; pressure){<br />        f(i++);<br />    }<br />    var end = (new Date()).getTime();<br />    WScript.Echo(end-start);<br />}<br /><br />/*<br />i=0<br />start = (new Date()).getTime();<br />while(i &lt; 60000){<br />    c = [i,i,i,i,i,i,i,i,i,i];<br />    i++;<br />}<br />end = (new Date()).getTime();<br />WScript.Echo(end-start);<br />i=0<br />start = (new Date()).getTime();<br />while(i &lt; 60000){<br />    c = new Array(i,i,i,i,i,i,i,i,i,i);<br />    i++;<br />}<br />var end = (new Date()).getTime();<br />WScript.Echo(end-start);</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/22183.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-01-22 08:44 <a href="http://www.cnitblog.com/asfman/articles/22183.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何优化JavaScript脚本的性能？</title><link>http://www.cnitblog.com/asfman/articles/22184.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 22 Jan 2007 00:44:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/22184.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/22184.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/22184.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/22184.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/22184.html</trackback:ping><description><![CDATA[
		<p>如何优化JavaScript脚本的性能？</p>
		<p>2006年11月18日 星期六 上午 00:05随着网络的发展，网速和机器速度的提高，越来越多的网站用到了丰富客户端技术。而现在Ajax则是最为流行的一种方式。JavaScript是一种解释型语言，所以能无法达到和C/Java之类的水平，限制了它能在客户端所做的事情，为了能改进他的性能，我想基于我以前给JavaScript做过的很多测试来谈谈自己的经验，希望能帮助大家改进自己的JavaScript脚本性能。<br /><br />语言层次方面<br />循环<br />循环是很常用的一个控制结构，大部分东西要依靠它来完成，在JavaScript中，我们可以使用for(;;),while(),for(in)三种循环，事实上，这三种循环中for(in)的效率极差，因为他需要查询散列键，只要可以就应该尽量少用。for(;;)和while循环的性能应该说基本（平时使用时）等价。<br /><br />而事实上，如何使用这两个循环，则有很大讲究。我在测试中有些很有意思的情况，见附录。最后得出的结论是：<br /><br />如果是循环变量递增或递减，不要单独对循环变量赋值，应该在它最后一次读取的时候使用嵌套的++或—操作符。<br /><br />如果要与数组的长度作比较，应该事先把数组的length属性放入一个局部变量中，减少查询次数。<br /><br />局部变量和全局变量<br />局部变量的速度要比全局变量的访问速度更快，因为全局变量其实是全局对象的成员，而局部变量是放在函数的栈当中的。<br /><br />不使用Eval<br />使用eval相当于在运行时再次调用解释引擎对内容进行运行，需要消耗大量时间。这时候使用JavaScript所支持的闭包可以实现函数模版（关于闭包的内容请参考函数式编程的有关内容）<br /><br />减少对象查找<br />因为JavaScript的解释性，所以a.b.c.d.e，需要进行至少4次查询操作，先检查a再检查a中的b，再检查b中的c，如此往下。所以如果这样的表达式重复出现，只要可能，应该尽量少出现这样的表达式，可以利用局部变量，把它放入一个临时的地方进行查询。<br /><br />这一点可以和循环结合起来，因为我们常常要根据字符串、数组的长度进行循环，而通常这个长度是不变的，比如每次查询a.length，就要额外进行一个操作，而预先把var len=a.length，则就少了一次查询。<br /><br />字符串连接<br />如果是追加字符串，最好使用s+=anotherStr操作，而不是要使用s=s+anotherStr。<br /><br />如果要连接多个字符串，应该少使用+=，如<br /><br />s+=a;s+=b;s+=c;<br />应该写成<br /><br />s+=a + b + c；<br />而如果是收集字符串，比如多次对同一个字符串进行+=操作的话，最好使用一个缓存。怎么用呢？使用JavaScript数组来收集，最后使用join方法连接起来，如下<br /><br />var buf = new Array();for(var i = 0; i &lt; 100; i++){ buf.push(i.toString());}var all = buf.join("");<br />类型转换<br />类型转换是大家常犯的错误，因为JavaScript是动态类型语言，你不能指定变量的类型。<br /><br />1. 把数字转换成字符串，应用"" + 1，虽然看起来比较丑一点，但事实上这个效率是最高的，性能上来说：<br /><br />("" +) &gt; String() &gt; .toString() &gt; new String() <br /><br />这条其实和下面的“直接量”有点类似，尽量使用编译时就能使用的内部操作要比运行时使用的用户操作要快。<br /><br />String()属于内部函数，所以速度很快，而.toString()要查询原型中的函数，所以速度逊色一些，new String()用于返回一个精确的副本。<br /><br />2. 浮点数转换成整型，这个更容易出错，很多人喜欢使用parseInt()，其实parseInt()是用于将字符串转换成数字，而不是浮点数和整型之间的转换，我们应该使用Math.floor()或者Math.round()。<br /><br />另外，和第二节的对象查找中的问题不一样，Math是内部对象，所以Math.floor()其实并没有多少查询方法和调用的时间，速度是最快的。<br /><br />3. 对于自定义的对象，如果定义了toString()方法来进行类型转换的话，推荐显式调用toString()，因为内部的操作在尝试所有可能性之后，会尝试对象的toString()方法尝试能否转化为String，所以直接调用这个方法效率会更高<br /><br />使用直接量<br />其实这个影响倒比较小，可以忽略。什么叫使用直接量，比如，JavaScript支持使用[param,param,param,...]来直接表达一个数组，以往我们都使用new Array(param,param,...)，使用前者是引擎直接解释的，后者要调用一个Array内部构造器，所以要略微快一点点。<br /><br />同样，var foo = {}的方式也比var foo = new Object();快，var reg = /../;要比var reg=new RegExp()快。<br /><br />字符串遍历操作<br />对字符串进行循环操作，譬如替换、查找，应使用正则表达式，因为本身JavaScript的循环速度就比较慢，而正则表达式的操作是用C写成的语言的API，性能很好。<br /><br />高级对象<br />自定义高级对象和Date、RegExp对象在构造时都会消耗大量时间。如果可以复用，应采用缓存的方式。<br /><br />DOM相关<br />插入HTML<br />很多人喜欢在JavaScript中使用document.write来给页面生成内容。事实上这样的效率较低，如果需要直接插入HTML，可以找一个容器元素，比如指定一个div或者span，并设置他们的innerHTML来将自己的HTML代码插入到页面中。<br /><br />对象查询<br />使用[“”]查询要比.items()更快，这和前面的减少对象查找的思路是一样的，调用.items()增加了一次查询和函数的调用。<br /><br />创建DOM节点<br />通常我们可能会使用字符串直接写HTML来创建节点，其实这样做<br /><br />无法保证代码的有效性<br /><br />字符串操作效率低<br /><br />所以应该是用document.createElement()方法，而如果文档中存在现成的样板节点，应该是用cloneNode()方法，因为使用createElement()方法之后，你需要设置多次元素的属性，使用cloneNode()则可以减少属性的设置次数——同样如果需要创建很多元素，应该先准备一个样板节点。<br /><br />定时器<br />如果针对的是不断运行的代码，不应该使用setTimeout，而应该是用setInterval。setTimeout每次要重新设置一个定时器。<br /><br />其他<br />脚本引擎<br />据我测试Microsoft的JScript的效率较Mozilla的Spidermonkey要差很多，无论是执行速度还是内存管理上，因为JScript现在基本也不更新了。但SpiderMonkey不能使用ActiveXObject<br /><br />文件优化<br />文件优化也是一个很有效的手段，删除所有的空格和注释，把代码放入一行内，可以加快下载的速度，注意，是下载的速度而不是解析的速度，如果是本地，注释和空格并不会影响解释和执行速度。<br /><br />总结<br />本文总结了我在JavaScript编程中所找到的提高JavaScript运行性能的一些方法，其实这些经验都基于几条原则：<br /><br />直接拿手头现成的东西比较快，如局部变量比全局变量快，直接量比运行时构造对象快等等。<br /><br />尽可能少地减少执行次数，比如先缓存需要多次查询的。<br /><br />尽可能使用语言内置的功能，比如串链接。<br /><br />尽可能使用系统提供的API，因为这些API是编译好的二进制代码，执行效率很高<br /><br />同时，一些基本的算法上的优化，同样可以用在JavaScript中，比如运算结构的调整，这里就不再赘述了。但是由于JavaScript是解释型的，一般不会在运行时对字节码进行优化，所以这些优化仍然是很重要的。<br /><br />当然，其实这里的一些技巧同样使用在其他的一些解释型语言中，大家也可以进行参考。<br /><br />参考<br />http://www.umsu.de/jsperf/ 各种浏览器的测试对比<br /><br />http://home.earthlink.net/~kendrasg/info/js_opt/ <br /><br />附录1<br />由于是以前做过的测试，测试代码已经不全，我补充了一部分如下：<br /><br />var print;<br /><br />if(typeof document != "undefined" ){<br />    print = function(){<br />  document.write(arguments[0]);<br /> }<br />}else if(typeof WScript != "undefined" ){<br />    print = function(){<br />        WScript.Echo(arguments[0],arguments[1],arguments[2]);<br />    }<br />}<br /><br />function empty(){<br />}<br /><br />function benchmark(f){<br />    var i = 0;<br />    var start = (new Date()).getTime();<br /> <br />    while(i &lt; pressure){<br />        f(i++);<br />    }<br />    var end = (new Date()).getTime();<br />    WScript.Echo(end-start);<br />}<br /><br />/*<br />i=0<br />start = (new Date()).getTime();<br />while(i &lt; 60000){<br />    c = [i,i,i,i,i,i,i,i,i,i];<br />    i++;<br />}<br />end = (new Date()).getTime();<br />WScript.Echo(end-start);<br />i=0<br />start = (new Date()).getTime();<br />while(i &lt; 60000){<br />    c = new Array(i,i,i,i,i,i,i,i,i,i);<br />    i++;<br />}<br />var end = (new Date()).getTime();<br />WScript.Echo(end-start);</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/22184.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-01-22 08:44 <a href="http://www.cnitblog.com/asfman/articles/22184.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何优化JavaScript脚本的性能？</title><link>http://www.cnitblog.com/asfman/articles/22185.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Mon, 22 Jan 2007 00:44:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/22185.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/22185.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/22185.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/22185.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/22185.html</trackback:ping><description><![CDATA[
		<p>如何优化JavaScript脚本的性能？</p>
		<p>2006年11月18日 星期六 上午 00:05随着网络的发展，网速和机器速度的提高，越来越多的网站用到了丰富客户端技术。而现在Ajax则是最为流行的一种方式。JavaScript是一种解释型语言，所以能无法达到和C/Java之类的水平，限制了它能在客户端所做的事情，为了能改进他的性能，我想基于我以前给JavaScript做过的很多测试来谈谈自己的经验，希望能帮助大家改进自己的JavaScript脚本性能。<br /><br />语言层次方面<br />循环<br />循环是很常用的一个控制结构，大部分东西要依靠它来完成，在JavaScript中，我们可以使用for(;;),while(),for(in)三种循环，事实上，这三种循环中for(in)的效率极差，因为他需要查询散列键，只要可以就应该尽量少用。for(;;)和while循环的性能应该说基本（平时使用时）等价。<br /><br />而事实上，如何使用这两个循环，则有很大讲究。我在测试中有些很有意思的情况，见附录。最后得出的结论是：<br /><br />如果是循环变量递增或递减，不要单独对循环变量赋值，应该在它最后一次读取的时候使用嵌套的++或—操作符。<br /><br />如果要与数组的长度作比较，应该事先把数组的length属性放入一个局部变量中，减少查询次数。<br /><br />局部变量和全局变量<br />局部变量的速度要比全局变量的访问速度更快，因为全局变量其实是全局对象的成员，而局部变量是放在函数的栈当中的。<br /><br />不使用Eval<br />使用eval相当于在运行时再次调用解释引擎对内容进行运行，需要消耗大量时间。这时候使用JavaScript所支持的闭包可以实现函数模版（关于闭包的内容请参考函数式编程的有关内容）<br /><br />减少对象查找<br />因为JavaScript的解释性，所以a.b.c.d.e，需要进行至少4次查询操作，先检查a再检查a中的b，再检查b中的c，如此往下。所以如果这样的表达式重复出现，只要可能，应该尽量少出现这样的表达式，可以利用局部变量，把它放入一个临时的地方进行查询。<br /><br />这一点可以和循环结合起来，因为我们常常要根据字符串、数组的长度进行循环，而通常这个长度是不变的，比如每次查询a.length，就要额外进行一个操作，而预先把var len=a.length，则就少了一次查询。<br /><br />字符串连接<br />如果是追加字符串，最好使用s+=anotherStr操作，而不是要使用s=s+anotherStr。<br /><br />如果要连接多个字符串，应该少使用+=，如<br /><br />s+=a;s+=b;s+=c;<br />应该写成<br /><br />s+=a + b + c；<br />而如果是收集字符串，比如多次对同一个字符串进行+=操作的话，最好使用一个缓存。怎么用呢？使用JavaScript数组来收集，最后使用join方法连接起来，如下<br /><br />var buf = new Array();for(var i = 0; i &lt; 100; i++){ buf.push(i.toString());}var all = buf.join("");<br />类型转换<br />类型转换是大家常犯的错误，因为JavaScript是动态类型语言，你不能指定变量的类型。<br /><br />1. 把数字转换成字符串，应用"" + 1，虽然看起来比较丑一点，但事实上这个效率是最高的，性能上来说：<br /><br />("" +) &gt; String() &gt; .toString() &gt; new String() <br /><br />这条其实和下面的“直接量”有点类似，尽量使用编译时就能使用的内部操作要比运行时使用的用户操作要快。<br /><br />String()属于内部函数，所以速度很快，而.toString()要查询原型中的函数，所以速度逊色一些，new String()用于返回一个精确的副本。<br /><br />2. 浮点数转换成整型，这个更容易出错，很多人喜欢使用parseInt()，其实parseInt()是用于将字符串转换成数字，而不是浮点数和整型之间的转换，我们应该使用Math.floor()或者Math.round()。<br /><br />另外，和第二节的对象查找中的问题不一样，Math是内部对象，所以Math.floor()其实并没有多少查询方法和调用的时间，速度是最快的。<br /><br />3. 对于自定义的对象，如果定义了toString()方法来进行类型转换的话，推荐显式调用toString()，因为内部的操作在尝试所有可能性之后，会尝试对象的toString()方法尝试能否转化为String，所以直接调用这个方法效率会更高<br /><br />使用直接量<br />其实这个影响倒比较小，可以忽略。什么叫使用直接量，比如，JavaScript支持使用[param,param,param,...]来直接表达一个数组，以往我们都使用new Array(param,param,...)，使用前者是引擎直接解释的，后者要调用一个Array内部构造器，所以要略微快一点点。<br /><br />同样，var foo = {}的方式也比var foo = new Object();快，var reg = /../;要比var reg=new RegExp()快。<br /><br />字符串遍历操作<br />对字符串进行循环操作，譬如替换、查找，应使用正则表达式，因为本身JavaScript的循环速度就比较慢，而正则表达式的操作是用C写成的语言的API，性能很好。<br /><br />高级对象<br />自定义高级对象和Date、RegExp对象在构造时都会消耗大量时间。如果可以复用，应采用缓存的方式。<br /><br />DOM相关<br />插入HTML<br />很多人喜欢在JavaScript中使用document.write来给页面生成内容。事实上这样的效率较低，如果需要直接插入HTML，可以找一个容器元素，比如指定一个div或者span，并设置他们的innerHTML来将自己的HTML代码插入到页面中。<br /><br />对象查询<br />使用[“”]查询要比.items()更快，这和前面的减少对象查找的思路是一样的，调用.items()增加了一次查询和函数的调用。<br /><br />创建DOM节点<br />通常我们可能会使用字符串直接写HTML来创建节点，其实这样做<br /><br />无法保证代码的有效性<br /><br />字符串操作效率低<br /><br />所以应该是用document.createElement()方法，而如果文档中存在现成的样板节点，应该是用cloneNode()方法，因为使用createElement()方法之后，你需要设置多次元素的属性，使用cloneNode()则可以减少属性的设置次数——同样如果需要创建很多元素，应该先准备一个样板节点。<br /><br />定时器<br />如果针对的是不断运行的代码，不应该使用setTimeout，而应该是用setInterval。setTimeout每次要重新设置一个定时器。<br /><br />其他<br />脚本引擎<br />据我测试Microsoft的JScript的效率较Mozilla的Spidermonkey要差很多，无论是执行速度还是内存管理上，因为JScript现在基本也不更新了。但SpiderMonkey不能使用ActiveXObject<br /><br />文件优化<br />文件优化也是一个很有效的手段，删除所有的空格和注释，把代码放入一行内，可以加快下载的速度，注意，是下载的速度而不是解析的速度，如果是本地，注释和空格并不会影响解释和执行速度。<br /><br />总结<br />本文总结了我在JavaScript编程中所找到的提高JavaScript运行性能的一些方法，其实这些经验都基于几条原则：<br /><br />直接拿手头现成的东西比较快，如局部变量比全局变量快，直接量比运行时构造对象快等等。<br /><br />尽可能少地减少执行次数，比如先缓存需要多次查询的。<br /><br />尽可能使用语言内置的功能，比如串链接。<br /><br />尽可能使用系统提供的API，因为这些API是编译好的二进制代码，执行效率很高<br /><br />同时，一些基本的算法上的优化，同样可以用在JavaScript中，比如运算结构的调整，这里就不再赘述了。但是由于JavaScript是解释型的，一般不会在运行时对字节码进行优化，所以这些优化仍然是很重要的。<br /><br />当然，其实这里的一些技巧同样使用在其他的一些解释型语言中，大家也可以进行参考。<br /><br />参考<br />http://www.umsu.de/jsperf/ 各种浏览器的测试对比<br /><br />http://home.earthlink.net/~kendrasg/info/js_opt/ <br /><br />附录1<br />由于是以前做过的测试，测试代码已经不全，我补充了一部分如下：<br /><br />var print;<br /><br />if(typeof document != "undefined" ){<br />    print = function(){<br />  document.write(arguments[0]);<br /> }<br />}else if(typeof WScript != "undefined" ){<br />    print = function(){<br />        WScript.Echo(arguments[0],arguments[1],arguments[2]);<br />    }<br />}<br /><br />function empty(){<br />}<br /><br />function benchmark(f){<br />    var i = 0;<br />    var start = (new Date()).getTime();<br /> <br />    while(i &lt; pressure){<br />        f(i++);<br />    }<br />    var end = (new Date()).getTime();<br />    WScript.Echo(end-start);<br />}<br /><br />/*<br />i=0<br />start = (new Date()).getTime();<br />while(i &lt; 60000){<br />    c = [i,i,i,i,i,i,i,i,i,i];<br />    i++;<br />}<br />end = (new Date()).getTime();<br />WScript.Echo(end-start);<br />i=0<br />start = (new Date()).getTime();<br />while(i &lt; 60000){<br />    c = new Array(i,i,i,i,i,i,i,i,i,i);<br />    i++;<br />}<br />var end = (new Date()).getTime();<br />WScript.Echo(end-start);</p>
<img src ="http://www.cnitblog.com/asfman/aggbug/22185.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-01-22 08:44 <a href="http://www.cnitblog.com/asfman/articles/22185.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>哪的资料都不如官方资料权威。今天总算从MSDN中择出了ASP编码问题的解决方案。</title><link>http://www.cnitblog.com/asfman/articles/21958.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Wed, 17 Jan 2007 00:28:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/21958.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/21958.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/21958.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/21958.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/21958.html</trackback:ping><description><![CDATA[
		<p>哪的资料都不如官方资料权威。今天总算从MSDN中择出了ASP编码问题的解决方案。</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>下面是MSDN中的一段话。</p>
										<p>Setting <strong>@CODEPAGE</strong> explicitly affects <span class="style4">literal strings in a single response.</span><b>Response.CodePage</b> affects <span class="style4">dynamic strings in a single response</span>, and <b>Session.CodePage</b> affects <span class="style4">dynamic strings in all responses in a session.</span></p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>这句话解释清楚了<strong>@CODEPAGE</strong>，<b>Response.CodePage，Session.CodePage</b> 分别的作用是什么。</p>
		<p>
				<strong>@CODEPAGE</strong>作用于所有静态的字符串，比如某文件中的 const blogname="我的家" </p>
		<p>
				<b>Response.CodePage</b>,<b>Session.CodePage</b>作用于所有动态输出的字符串，比如&lt;%=blogname%&gt;</p>
		<p>这句话很关键的是说明了<b>Response.CodePage的作用范围是</b><span class="style4">a single response</span>，而SXNA中声明的<b>Session.CodePage</b>的作用范围是<span class="style4">all responses in a session。</span></p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>再看另外一句话。</p>
										<p>If <strong>Response.CodePage</strong> is <span class="style4">not explicitly set in a page</span>, it is <span class="style4">implicitly set by Session.CodePage</span>, <strong>if sessions are enabled</strong>. <strong>If sessions are not enabled</strong>, <strong>Response.CodePage</strong> is set by<strong> @CodePage</strong>, if @CodePage is present in the page. If there is no <b>@CodePage</b> in the page, Response.CodePage is set by the <b>AspCodePage</b> metabase property. If the <b>AspCodePage</b> metabase property is not set, or set to 0, Response.CodePage is set by the system ANSI code page.</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>这句话我乍一看，把意思理解成了这样：在sessions are enabled的时候，如果Response.CodePage没有声明，则Response.CodePage会被Session.CodePage赋值。如果sessions are not enabled的时候, 如果@CodePage已声明，则Response.CodePage会被@CodePage赋值，等等.............</p>
		<p>这句话解释了为什么从SXNA中出来以后进入一些别的页面比如oblog,z-blog等等容易出现乱码，因为其他程序没有声明Response.CodePage而恰巧SXNA声明了Session.CodePage，因此一进入SXNA，Session.CodePage立即被赋值（版本不同，有的版本赋了936有的版本赋了65001），<strong>而后进入其他程序的时候Response.CodePage马上被Session.CodePage赋值</strong>，<strong>如果这时Response.CodePage与页面本身编码不一样的话</strong>，页面就会出现乱码。所以进入z-blog出现乱码的时候我查了当时的Session.CodePage和Response.CodePage都是936，而进入oblog出现乱码的时候Session.CodePage和Response.CodePage都是65001.就是说要想保证叶面不出现乱码，应该声明Response.CodePage，否则他就会按照Session.CodePage来解释网页（而不是按照@codepage解释网页）.</p>
		<p>如果仅仅按照上面的解释的话，我实际上是很糊涂的，因为我们都是用的中文操系统，当每一次进入浏览器的时候你可以尝试输出Session.CodePage，能看到他都是936！为什么进入Z-blog的时候他不把默认的Session.CodePage的936赋给Response.CodePage呢？反而把@CodePage给了Response.CodePage？什么情况下Session.CodePage才赋值给Response.CodePage呢？原文的sessions are enabled应该如何理解呢？</p>
		<p>也许上面的话应该这样理解：</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#fbeeff" border="0">
				<tbody>
						<tr>
								<td>
										<p>
												<strong>在Session.CodePage<span class="style9">被</span>任何程序声明的时候，如果Response.CodePage没有声明，则Response.CodePage会被Session.CodePage赋值。如果Session.CodePage<span class="style9">没有被</span>任何程序声明的时候, 如果@CodePage已声明，则Response.CodePage会被@CodePage赋值，....，<span class="style9">最后的页面动态内容部分按照Response.CodePage的值解释。</span></strong>
										</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>因为Zblog和Oblog都声明了@CodePage，所以，用户刚刚启动完机器然后进入浏览器浏览Zblog和Oblog的时候Response.CodePage会被@CodePage赋值，于是叶面显示正常。</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>这句话进一步解释了产生乱码的原因</p>
										<p>If you set <b>Response.CodePage</b> or <b>Session.CodePage</b> explicitly, do so before sending non-literal strings to the client. If you use literal and non-literal strings in the same page, make sure the code page of <strong>@CODEPAGE</strong> matches the code page of <b>Response.CodePage</b>, or the literal strings are encoded differently from the non-literal strings and display incorrectly.</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>其中比较有用的一句话是说如果<b>Response.CodePage</b>和<strong>@CODEPAGE</strong>不一样的话会产生乱码。也就是说当Z-blog的<strong>@CODEPAGE</strong>=65001而Z-blog的Response.CodePage被<b>Session.CodePage</b>赋为936的时候就会出现乱码，oblog反之亦然。</p>
		<p>不知道上面说了这么多解释清楚没有-_-||</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>下面解释一下为什么SXNA有时会把Session.CodePage赋为936，我有一个版本是这样写的：</p>
										<p>&lt;% OriginalCodePage=Session.CodePage %&gt;</p>
										<p>.......</p>
										<p>&lt;% Session.CodePage=OriginalCodePage %&gt;</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>当用户进入浏览器的时候Session.CodePage默认为936，这个时候的默认936不是程序声明的，因此不会赋给<b>Response.CodePage</b>，当进入SXNA的时候，<strong>Session.CodePage</strong>被上面那段代码<span class="style10">一折腾</span>就变成了程序声明的<strong>Session.CodePage=936</strong>,因此再进入Zblog的时候就把936给了<b>Response.CodePage</b>。</p>
		<p>至此，全部原因已经分析清楚了。</p>
		<p>因此说，保证asp叶面一定不会出现乱码的代码应该是这样的：（假定是UTF-8的叶子）</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>&lt;%@ CODEPAGE=65001 %&gt;</p>
										<p>&lt;% Response.CodePage=65001%&gt;</p>
										<p>&lt;% Response.Charset="UTF-8" %&gt;</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>进一步说明为什么要加Response.Charset，因为MSDN说应该加...呵呵</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>If the code page is set in a page, then <b>Response.Charset</b> should also be set.</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>另外，文件的编码格式应该与@CODEPAGE一样:</p>
		<p>
		</p>
		<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellspacing="0" cellpadding="12" width="95%" bgcolor="#f6f6f6" border="0">
				<tbody>
						<tr>
								<td>
										<p>The file format of a Web page must be the same as the @CODEPAGE used in the page.</p>
								</td>
						</tr>
				</tbody>
		</table>
		<p>这就是为什么zblog,pjblog等一些程序要吧文件存成UTF8编码格式的原因.</p>
		<p>综上，如果所有的程序都声明了Response.CodePage就不会被Session.CodePage干扰而出现乱码了。所以Session.CodePage还是不能轻易用的！</p>
		<a href="http://www.asfman.cn/demo/readfile.asp">
		</a>
<img src ="http://www.cnitblog.com/asfman/aggbug/21958.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2007-01-17 08:28 <a href="http://www.cnitblog.com/asfman/articles/21958.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>