<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" processed="0.062" queries="1" focusMarkup="" xslt=""><channel><title><![CDATA[Alvin's Blog]]></title><link>http://www.ialvin.cn/blog/</link><description>不停揣测你心里，可有我姓名……</description><language>zh-cn</language><copyright><![CDATA[Copyright©2008 IAlvin.CN]]></copyright><webMaster><![CDATA[78423497@qq.com(林志斌)]]></webMaster><generator><![CDATA[ABlog v1.0]]></generator><image><title>Alvin's Blog</title><url>http://www.ialvin.cn/blog/images/logos.gif</url><link>http://www.ialvin.cn/blog/</link><description>不停揣测你心里，可有我姓名……</description></image><item><link>http://www.ialvin.cn/blog/article.asp?id=173</link><title><![CDATA[以前用的一个 flash 留言本]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[心情日志]]></category><pubDate>2010-05-20 17:01:24</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=173</guid><description><![CDATA[&#32763;&#30475;&#19968;&#20123;&#26087;&#25991;&#20214;&#26102;, &#24573;&#28982;&#25214;&#21040;&#20197;&#21069;&#22312; x-woods &#30003;&#35831;&#30340; flash &#30041;&#35328;&#26495;&#38142;&#25509;.<br />&#24448;&#27983;&#35272;&#22120;&#19968;&#36148;, &#23621;&#28982;&#36824;&#21487;&#20197;&#25171;&#24320;.<br /><br />&#30041;&#35328;&#20449;&#24687;&#20063;&#36824;&#22312;<br /><br /><a href='http://www.x-woods.com/service/book/x.swf?bookId=10578' target='_blank'>http://www.x-woods.com/service/book/x.swf?bookId=10578</a><br /><br />^_^ &#24576;&#26087;&#19968;&#19979;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=172</link><title><![CDATA[JavaScript 进行 URLEncode (使用 GBK)]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[网络开发]]></category><pubDate>2010-03-19 14:03:33</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=172</guid><description><![CDATA[&#36824;&#26159;&#32769;&#38382;&#39064;, &#24819;&#22312; javascript　&#20013;&#36827;&#34892; URLEncode, &#24076;&#26395;&#20351;&#29992; GBK &#38598;.<br />&#20294;&#26159; javascript &#24182;&#19981;&#25903;&#25345;.<br /><br />&#24819;&#21040;&#20102;&#19968;&#20010;&#19981;&#20351;&#29992;&#20307;&#31215;&#22823;&#22823;&#30340;&#23545;&#29031;&#34920;&#30340;&#27861;&#23376;.<br /><br />&#22312; Firefox, Chrome, Opera &#26368;&#26032;&#29256;&#26412;&#19979;,&#22343;&#27979;&#35797;&#36890;&#36807;:<br /><br /><textarea name='code' class='js' cols='50'>
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=GBK&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function encodeURL(s) {
	var img = document.createElement(&quot;img&quot;);
	function escapeDBC(s) {
		if (!s) return &quot;&quot;
		if (window.ActiveXObject) return s.replace(/[\d\D]/g, function($0) {
			window.vbsval = &quot;&quot;;
			execScript('window.vbsval=Hex(Asc(&quot;' + $0 + '&quot;))', &quot;vbscript&quot;)
			return &quot;%&quot; + window.vbsval.slice(0,2) + &quot;%&quot; + window.vbsval.slice(-2);
		});
		img.src = &quot;nothing.asp?key=&quot; + s;
		return img.src.split(&quot;key=&quot;).pop();
	}
	return s.replace(/([^\x00-\xff]+)|([\x00-\xff]+)/g, function($0, $1, $2) {
		return escapeDBC($1) + encodeURIComponent($2||'');
	});
}


alert(encodeURL(&quot;&#20013;&#25991;&quot;));
&lt;/script&gt;</textarea><br /><br />&#33267;&#27492;, &#22312;&#23458;&#25143;&#31471;&#20351;&#29992; GB &#38598;&#23545;&#25991;&#23383;&#36827;&#34892; URI &#30340;&#38382;&#39064;&#20284;&#20046;&#23601;&#35299;&#20915;&#20102;.]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=171</link><title><![CDATA[ASP( VBScript ) 解析 JSON]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[网络开发]]></category><pubDate>2009-11-04 12:57:54</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=171</guid><description><![CDATA[VBScript &#26159; ASP &#26381;&#21153;&#31471;&#31243;&#24207;&#30340;&#24120;&#29992;&#35821;&#35328;.<br />VBScript &#35299;&#26512; JSON&#26159;&#20010;&#38382;&#39064;. &#33258;&#24049;&#20889;&#35299;&#26512;&#31243;&#24207;,&#24403;&#28982;&#19981;&#23481;&#26131;.<br /><br />&#30896;&#21040;&#36825;&#38382;&#39064;, &#31532;&#19968;&#20010;&#24819;&#21040;&#30340;&#23601;&#26159; JScript &#20102;.<br /><textarea name='code' class='vb' cols='50'>&lt;script language=&quot;jscript&quot; runat=&quot;server&quot;&gt;
Array.prototype.get = function(x) { return this[x]; };
function parseJSON(strJSON) { return eval(&quot;(&quot; + strJSON + &quot;)&quot;); }
&lt;/script&gt;
&lt;%
Dim json, obj
json = &quot;{a:&quot;&quot;aaa&quot;&quot;, b:{ name:&quot;&quot;bb&quot;&quot;, value:&quot;&quot;text&quot;&quot; }, c:[&quot;&quot;item0&quot;&quot;, &quot;&quot;item1&quot;&quot;, &quot;&quot;item2&quot;&quot;]}&quot;
Set obj = parseJSON(json)

Response.Write obj.a &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.b.name &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.c.length &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.c.get(0) &amp; &quot;&lt;br /&gt;&quot;

Set obj = Nothing
%&gt;</textarea>&#36825;&#26159;&#30452;&#25509;&#22312; asp &#37324;&#28151;&#29992;&#33050;&#26412;.<br />&#36824;&#26377;&#19968;&#20010;&#26041;&#27861;&#23601;&#26159; &#20351;&#29992; MS &#30340; &#33050;&#26412;&#25511;&#20214;. <br />&#20063;&#19968;&#26679;&#26159;&#20351;&#29992;&#20102; JScript<br /><textarea name='code' class='vb' cols='50'>
Dim scriptCtrl
Function parseJSON(str)
	If Not IsObject(scriptCtrl) Then
		Set scriptCtrl = Server.CreateObject(&quot;MSScriptControl.ScriptControl&quot;)
		scriptCtrl.Language = &quot;JScript&quot;
		scriptCtrl.AddCode &quot;Array.prototype.get = function(x) { return this[x]; }; var result = null;&quot;
	End If
	scriptCtrl.ExecuteStatement &quot;result = &quot; &amp; str &amp; &quot;;&quot;
	Set parseJSON = scriptCtrl.CodeObject.result
End Function

Dim json
json = &quot;{a:&quot;&quot;aaa&quot;&quot;, b:{ name:&quot;&quot;bb&quot;&quot;, value:&quot;&quot;text&quot;&quot; }, c:[&quot;&quot;item0&quot;&quot;, &quot;&quot;item1&quot;&quot;, &quot;&quot;item2&quot;&quot;]}&quot;

Set obj = parseJSON(json)

Response.Write obj.a &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.b.name &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.c.length &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.c.get(0) &amp; &quot;&lt;br /&gt;&quot;

Set obj = Nothing

Set scriptCtrl = Nothing
</textarea><br /><br /><br />--------------- 2009.12.31 ---------------<br /><br />&#20043;&#21069;&#20889;&#36825;&#20010;&#26102;,&#36824;&#24573;&#30053;&#20102;&#19968;&#20010;&#38382;&#39064;.<br /><br />&#19978;&#38754;&#20108;&#20010;&#26041;&#27861;&#37117;&#20351;&#29992;&#20102; jscript &#25226; json &#20018;&#35299;&#26512;&#25104; js &#23545;&#35937;.<br /><br />&#19981;&#21516;&#20043;&#22788;&#26159;, &#31532;&#19968;&#20010;&#26041;&#27861;, eval &#26159;&#22312;&#24403;&#21069;&#23487;&#20027;&#29615;&#22659;&#20013;&#25191;&#34892;.<br />&#31532;&#20108;&#20010;&#26041;&#27861;&#26159;, &#22312;&#21478;&#22806;&#30340;&#23487;&#20027;&#29615;&#22659;&#20013;&#25191;&#34892;.<br /><br />&#36825;&#28041;&#21450;&#21040;&#20102;&#19968;&#20010;&#23433;&#20840;&#24615;&#38382;&#39064;. json &#22914;&#26524;&#26159;&#20174;&#23458;&#25143;&#31471;&#25552;&#20132;&#19978;&#26469;&#30340;&#35805;, &#38590;&#20197;&#20445;&#35777;&#27809;&#26377;&#24694;&#24847;&#29992;&#25143;&#25552;&#20132;&#38750;&#27861;&#20195;&#30721;...<br />&#36825;&#26679;,&#31532;&#19968;&#20010;&#26041;&#27861;,&#23601;&#20250;&#22312;&#24403;&#21069;&#29615;&#22659;&#20013; eval(...&#24694;&#24847;&#20195;&#30721;...)　&#21518;&#26524;&#19981;&#22570;&#35774;&#24819;!!!<br /><br />&#31532;&#20108;&#20010;&#26041;&#27861;,&#21019;&#24314;&#20102; ScriptControl &#25511;&#20214;, &#22312;&#37324;&#38754;&#25191;&#34892;&#20195;&#30721;&#21017;&#30456;&#23545;&#23433;&#20840;&#20102;, &#22240;&#20026;&#26159;&#22312;&#19968;&#20010;&#38548;&#31163;&#36215;&#26469;&#30340;&#29615;&#22659;&#20013;&#25191;&#34892;.<br />&#20294;&#36824;&#26377;&#20004;&#20010;&#19996;&#19996;&#35201;&#32473;&#20808;&#21345;&#25481;, &#22240;&#20026;&#20195;&#30721;&#22312; ScriptControl &#20013;&#25191;&#34892;,&#20063;&#21487;&#20197;&#22312;&#37324;&#38754;&#20351;&#29992; ActiveXObject &#25110; GetObject &#19982;&#22806;&#30028;&#25171;&#20132;&#36947;..<br />&#20173;&#28982;&#19981;&#23433;&#20840;.<br /><br />&#36825;&#26102;&#20505;,&#23601;&#26377;&#24517;&#35201;&#20877;&#35843;&#25972;&#19968;&#19979;&#20195;&#30721;:<br /><textarea name='code' class='vb' cols='50'>
Dim scriptCtrl
Function parseJSON(str)
	If Not IsObject(scriptCtrl) Then
		Set scriptCtrl = Server.CreateObject(&quot;MSScriptControl.ScriptControl&quot;)
		scriptCtrl.Language = &quot;JScript&quot;
		scriptCtrl.AddCode &quot;function ActiveXObject() {}&quot; ' &#35206;&#30422; ActiveXObject
		scriptCtrl.AddCode &quot;function GetObject() {}&quot; ' &#35206;&#30422; ActiveXObject
		scriptCtrl.AddCode &quot;Array.prototype.get = function(x) { return this[x]; }; var result = null;&quot;
	End If
  On Error Resume Next
	scriptCtrl.ExecuteStatement &quot;result = &quot; &amp; str &amp; &quot;;&quot;
	Set parseJSON = scriptCtrl.CodeObject.result
  If Err Then
	Err.Clear
	Set parseJSON = Nothing
  End If
End Function

Dim json
json = &quot;{a:&quot;&quot;aaa&quot;&quot;, b:{ name:&quot;&quot;bb&quot;&quot;, value:&quot;&quot;text&quot;&quot; }, c:[&quot;&quot;item0&quot;&quot;, &quot;&quot;item1&quot;&quot;, &quot;&quot;item2&quot;&quot;]}&quot;

Set obj = parseJSON(json)

Response.Write obj.a &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.b.name &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.c.length &amp; &quot;&lt;br /&gt;&quot;
Response.Write obj.c.get(0) &amp; &quot;&lt;br /&gt;&quot;

Set obj = Nothing


If IsObject(scriptCtrl) Then Set scriptCtrl = Nothing
</textarea>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=170</link><title><![CDATA[ASP 中 Base64 的编解码]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[学习随笔]]></category><pubDate>2009-10-22 02:14:30</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=170</guid><description><![CDATA[Base64 &#32534;&#30721;&#23383;&#31526;&#20018; &#19982; byte &#25968;&#32452;&#38388;&#30340;&#20114;&#36716;<br /><br />VBScript &#29256;&#26412;<textarea name='code' class='vb' cols='50'>
Function DecodeBase64(str)
	With CreateObject(&quot;Microsoft.XMLDOM&quot;).createElement(&quot;TXT&quot;)
		.dataType = &quot;bin.base64&quot;
		.text = str
		DecodeBase64 = .nodeTypedValue
	End With
End Function

Function EncodeBase64(bytes)
	With CreateObject(&quot;Microsoft.XMLDOM&quot;).createElement(&quot;TXT&quot;)
		.dataType = &quot;bin.base64&quot;
		.nodeTypedValue = bytes
		EncodeBase64 = .text
	End With
End Function
</textarea><br /><br />JScript &#29256;&#26412;<textarea name='code' class='js' cols='50'>
var Base64Encoder = {
	encode : function(str) {
		with (Server.CreateObject(&quot;Microsoft.XMLDOM&quot;).createElement(&quot;TXT&quot;)) {
			dataType = &quot;bin.base64&quot;;
			text = str;
			return nodeTypedValue;
		}
	},
	decode : function(bts) {
		with (Server.CreateObject(&quot;Microsoft.XMLDOM&quot;).createElement(&quot;TXT&quot;)) {
			dataType = &quot;bin.base64&quot;;
			nodeTypedValue = bts;
			return text;
		}
	}
};
</textarea>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=169</link><title><![CDATA[那些可爱人儿]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[心情日志]]></category><pubDate>2009-07-31 23:14:17</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=169</guid><description><![CDATA[&#12288;&#12288;&#27605;&#19994;&#21518;&#23601;&#25104;&#20102;&#22823;&#22478;&#24066;&#37324;&#30340;&#27665;&#24037;&#65292;&#31163;&#26657;&#23558;&#36817;&#19968;&#26376;&#12290;&#31245;&#24494;&#21152;&#24555;&#30340;&#29983;&#27963;&#33410;&#22863;&#21644;&#31245;&#24494;&#21152;&#37325;&#30340;&#29983;&#27963;&#21387;&#21147;&#65292;&#33258;&#24049;&#26377;&#28857;&#19981;&#36866;&#24212;&#65292;&#19968;&#30452;&#24819;&#30528;&#20986;&#26469;&#25171;&#25340;&#30340;&#25105;&#65292;&#29616;&#22312;&#21364;&#20284;&#20046;&#19981;&#24895;&#24847;&#25215;&#35748;&#33258;&#24049;&#24050;&#19981;&#26159;&#23398;&#29983;&#8230;&#8230;<br /><br />&#12288;&#12288;&#24819;&#30528;&#22235;&#24180;&#26469;&#19968;&#30452;&#26397;&#22805;&#30456;&#22788;&#30340;&#20154;&#20799;&#23601;&#20877;&#20063;&#27809;&#26377;&#20160;&#20040;&#26426;&#20250;&#32858;&#22312;&#19968;&#36215;&#20102;&#65292;&#36825;&#38453;&#23376;&#24635;&#26377;&#37027;&#20040;&#20123;&#20260;&#24863;&#12290;&#22823;&#22823;&#30007;&#29983;&#20063;&#20687;&#22899;&#29983;&#19968;&#26679;&#30340;&#22810;&#24833;&#21892;&#24863;&#20040;&#65311;&#20063;&#35768;&#21543;&#65292;&#25105;&#36824;&#26159;&#35748;&#20026;&#26159;&#22235;&#24180;&#26469;&#21516;&#31383;&#24050;&#32467;&#19979;&#19981;&#35299;&#30340;&#24773;&#35850;&#12290;&#25105;&#19968;&#30452;&#37117;&#36825;&#20040;&#35273;&#24471;&#65292;&#25105;&#36523;&#36793;&#30340;&#20154;&#19968;&#20010;&#20010;&#37117;&#26159;&#36825;&#20040;&#30340;&#21487;&#29233;&#12290;&#25105;&#19981;&#33021;&#32943;&#23450;&#36825;&#31181;&#24863;&#35273;&#20197;&#21518;&#26159;&#21542;&#20250;&#21464;&#30340;&#24456;&#28129;&#65292;&#29978;&#33267;&#23436;&#20840;&#22833;&#21435;&#12290;&#37117;&#35828;&#36367;&#20837;&#31038;&#20250;&#21518;&#65292;&#20154;&#20250;&#21464;&#24471;&#19981;&#30495;&#12290;&#36825;&#26102;&#20505;&#65292;&#25105;&#24819;&#25105;&#24471;&#35760;&#19979;&#28857;&#20160;&#20040;&#20102;&#12290;<br /><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1248362180&quot;);void(0);'><font color='Blue'>2009.07.23&#8212;&#8212;&#23567;&#36125;&#31687;</font></a><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1248549571&quot;);void(0);'><font color='Blue'>2009.07.26&#8212;&#8212;&#26999;&#21733;&#31687;</font></a><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1248635040&quot;);void(0);'><font color='Blue'>2009.07.27&#8212;&#8212;&#22823;&#31098;&#31687;</font></a><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1249056321&quot;);void(0);'><font color='Blue'>2009.08.01&#8212;&#8212;&#38463;&#31119;&#31687;</font></a><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1249404246&quot;);void(0);'><font color='Blue'>2009.08.05&#8212;&#8212;&#65291;&#65291;&#31687;</font></a><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1250093462&quot;);void(0);'><font color='Blue'>2009.08.05&#8212;&#8212;&#40657;&#40657;&#31687;</font></a><br /><a href='javascript:open(&quot;http://user.qzone.qq.com/78423497/blog/1251653499&quot;);void(0);'><font color='Blue'>2009.08.31&#8212;&#8212;&#21335;&#21733;&#31687;</font></a><br /><br />&#8230;&#8230;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=168</link><title><![CDATA[[JAVA]大数开平方(模拟手算的方法)]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[学习随笔]]></category><pubDate>2009-05-21 03:55:16</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=168</guid><description><![CDATA[&#22312; CSDN &#30475;&#21040;&#30340;&#38382;&#39064;&#12290;&#12288;&#35201;&#27714;&#31639;&#20986;&#24320;&#24179;&#26041;&#32467;&#26524;&#30340;&#31934;&#30830;&#25972;&#25968;&#37096;&#20998;<br />&#24819;&#20102;&#24819;&#65292;&#24819;&#19981;&#21040;&#21035;&#30340;&#22909;&#30340;&#26041;&#27861;&#12288;&#23601;&#29992;&#20102;&#25720;&#25311;&#25163;&#31639;&#30340;&#26041;&#27861;<br /><textarea name='code' class='js' cols='50'>
public static void main(String[] args) {
        System.out.print(&quot;sqrt(1)=&quot; + sqrt(&quot;1&quot;));
        System.out.print(&quot;\tsqrt(25)=&quot; + sqrt(&quot;25&quot;));
        System.out.print(&quot;\tsqrt(26)=&quot; + sqrt(&quot;26&quot;));  // sqrt(26)==5 &#21621;&#21621;,&#22240;&#20026;&#21482;&#26377;&#25972;&#25968;&#37096;&#20998;
        System.out.print(&quot;\tsqrt(100)=&quot; + sqrt(&quot;100&quot;));
        System.out.println(&quot;\tsqrt(144)=&quot; + sqrt(&quot;144&quot;));
        
        // &#29983;&#25104;&#19968;&#20010; 5000 &#20301;&#20197;&#20869;&#30340;&#25968;
        StringBuffer sb = new StringBuffer(&quot;&quot;);
        Random rand = new Random();
        int length = rand.nextInt(5000)+1;
        for (int i=0; i&lt;length; i++)
            sb.append(rand.nextInt(10));
        String theNumber = sb.toString();

        System.out.println(&quot;n:&quot; + sb.toString());
        System.out.println(&quot;&#20301;&#25968;:&quot; + length);

        // &#24320;&#26041;
        long t = System.currentTimeMillis();
        BigInteger result = sqrt(theNumber);
        t = System.currentTimeMillis()-t;

        System.out.println(&quot;sqrt(n)=&quot; + result.toString());
        System.out.println(&quot;&#29992;&#26102;:&quot; + t + &quot;&#27627;&#31186;&quot;);
    }

    public static BigInteger sqrt(String theNumber) {
        int length = theNumber.length(), i;
        BigInteger res = BigInteger.ZERO;
        BigInteger twenty = BigInteger.valueOf(20);
        BigInteger t, x=BigInteger.ZERO, v, few=BigInteger.ZERO;
        BigInteger hg = BigInteger.valueOf(100);

        String tmpString = null;
        int pos = 2-length%2;
        tmpString = theNumber.substring(0, pos);
        while (true) {
            v = few.multiply(hg).add(BigInteger.valueOf(Integer.parseInt(tmpString)));
            if (res.compareTo(BigInteger.ZERO)==0) i=9;
            else i = v.divide(res.multiply(twenty)).intValue();
            for (; i&gt;=0; i--) {
                t = res.multiply(twenty).add(BigInteger.valueOf(i)).multiply(BigInteger.valueOf(i));
                if (t.compareTo(v)&lt;=0) {
                    x = t;
                    break;
                }
            }
            res = res.multiply(BigInteger.TEN).add(BigInteger.valueOf(i));
            few = v.subtract(x);
            pos++;
            if (pos&gt;length) break;
            tmpString = theNumber.substring(pos-1, ++pos);
        }
        return res;
    }
</textarea>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=167</link><title><![CDATA[放个可以做简单数学四则运算的东东]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[学习随笔]]></category><pubDate>2009-05-03 22:29:23</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=167</guid><description><![CDATA[&#36935;&#21040;&#35201;&#27714;&#19968;&#20010;&#36816;&#31639;&#34920;&#36798;&#24335;&#30340;&#35745;&#31639;&#32467;&#26524;&#30340;&#38382;&#39064;<br />&#20256;&#36827;&#30340;&#26159;&#19968;&#20010;&#23383;&#31526;&#20018; (&#23383;&#20018;&#20869;&#23481;&#24403;&#28982;&#26159;&#34920;&#36798;&#24335;&#20102;)<br />&#26368;&#32456;&#35201;&#27714;&#20986;&#36816;&#31639;&#32467;&#26524;<br /><br />&#20043;&#21069;&#22312; JScript &#25110; VBScript &#37324;&#36890;&#24120;&#26159; eval &#26469;&#35299;&#20915;<br />&#19979;&#38754;&#32473;&#20010; Java &#30340;<br /><br />&#21482;&#33021;&#31639; +-*/ &#36824;&#26377;&#25324;&#21495;<br /><br /><textarea name='code' class='js' cols='50'>/**
 * (#)Calculator.java&#12288;&#12288;&#12288;&#12288;&#21019;&#24314;&#26102;&#38388;&#65306;Apr 30, 2009 6:14:03 PM&lt;br /&gt;
 */
package cn.ialvin.util;

import java.util.Stack;
import java.util.regex.Pattern;

/**
 * @author &#26519;&#24535;&#25996;(&lt;b&gt;ialvin.cn&lt;/b&gt;) &#24191;&#19996; &#26222;&#23425; &#37324;&#28246;
 */
public class Calculator {
    
    public static void main(String[] args) {
        String exp = &quot;-3.3 + 1.5 * (- 3 + -5)&quot;;
        Calculator calculator = new Calculator();
        System.out.println(calculator.cal(exp));
    }
    
    public double cal(String exp) {
        exp = adj(exp);
        exp = conver(exp);
        Stack&lt;Object&gt; stack = new Stack&lt;Object&gt;();
        String[] cs = exp.split(&quot;[^\\d.+\\-*/]+&quot;);
        int i = 0;
        while (i &lt; cs.length) {
            String c = cs<i>; i++;
            if (&quot;+&quot;.equals(c)) {
                stack.push((Double)stack.pop() + (Double)stack.pop());
            } else if (&quot;-&quot;.equals(c)) {
                stack.push(0 - (Double)stack.pop() + (Double)stack.pop());
            } else if (&quot;*&quot;.equals(c)) {
                stack.push((Double)stack.pop() * (Double)stack.pop());
            } else if (&quot;/&quot;.equals(c)) {
                stack.push(1 / (Double)stack.pop() * (Double)stack.pop());
            } else {
                stack.push(Double.parseDouble(c));
            }
        }
        return Double.parseDouble(stack.pop().toString());
    }

    private String adj(String exp) {
        exp = exp.replaceAll(&quot;[^\\d.+\\-*\\/()]+&quot;, &quot;&quot;);
        exp = exp.replaceAll(&quot;(^|[(+\\-*\\/])\\-([\\d.]+)&quot;, &quot;$1(0-$2)&quot;);
        return exp.replaceAll(&quot;[+\\-*\\/()]&quot;, &quot; $0 &quot;).trim();
    }
    
    private String conver(String exp) {
        String[] str = exp.split(&quot;\\s+&quot;);
        Stack&lt;String&gt; expStack = new Stack&lt;String&gt;();
        for(int i = str.length - 1 ; i &gt;= 0 ; i--)
            expStack.push(str<i>);
        Stack&lt;String&gt; outStack = new Stack&lt;String&gt;();
        Stack&lt;String&gt; operStack = new Stack&lt;String&gt;();
        operStack.push(&quot;#&quot;);
        while (expStack.size()&gt; 0) {
            String c = expStack.pop().toString();
            if (c.matches(&quot;^\\d+(?:\\.\\d*)?$&quot;)) {
                outStack.push(c);
            } else if (&quot;(&quot;.equals(c)) {
                operStack.push(c);
            } else if (&quot;)&quot;.equals(c)) {
                if (operStack.lastElement().equals(&quot;(&quot;)) {
                    operStack.pop();
                } else {
                    expStack.push(c);
                    outStack.push(operStack.pop());
                }
            } else {
                if (comparison(c, operStack.lastElement()))
                    outStack.push(operStack.pop());
                operStack.push(c);
            }
        }
        operStack.remove(operStack.firstElement());
        while(!operStack.empty())
            outStack.push(operStack.pop());
        return outStack.toString().replaceAll(&quot;\\[|\\]|\\,&quot;, &quot;&quot;);
    }
    
    private int getLevel(Object o) {
        if (&quot;(&quot;.equals(o)) return 1;
        if (&quot;+&quot;.equals(o)) return 2;
        if (&quot;-&quot;.equals(o)) return 2;
        if (&quot;*&quot;.equals(o)) return 3;
        if (&quot;/&quot;.equals(o)) return 3;
        return -1;
    }
    
    private boolean comparison(String c1 ,Object c2) {
        return getLevel(c2)-getLevel(c1) &gt;= 0;
    }
}</textarea>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=165</link><title><![CDATA[写了个 JavaScript  烟花]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[学习随笔]]></category><pubDate>2009-01-05 17:39:48</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=165</guid><description><![CDATA[&#22312; CSDN &#30475;&#21040;&#20010; &quot;&#12304;&#32534;&#31243;&#28216;&#25103;&#12305;&#36154;&#23681;&#25918;&#31036;&#33457;&quot; &#30340; JavaScript &#27963;&#21160;&#12290;<br /><a href='http://topic.csdn.net/u/20090104/17/db61e39c-7aed-46e0-8a0f-b571497f087c.html' target='_blank'>http://topic.csdn.net/u/20090104/17/db61e39c-7aed-46e0-8a0f-b571497f087c.html</a><br />&#30475;&#20102;&#20154;&#23478;&#22909;&#22810;&#20010;&#28418;&#20142;&#30340;&#20316;&#21697;&#65292;&#33258;&#24049;&#20063;&#24819;&#32451;&#32451;&#12290;<br /><br />&#32993;&#20081;&#20889;&#20102;&#19968;&#20010;&#31616;&#21333;&#28857;&#30340;&#65292;&#25237;&#19978;&#21435;&#12290;&#24403;&#26159;&#35760;&#24405;&#33258;&#24049;&#30340;&#23398;&#20064;&#21382;&#31243;&#12290;<br />&#8220;<a href='http://blog.csdn.net/zswang/archive/2009/01/05/3709929.aspx' target='_blank'><font color='Red'>&#12304;&#32534;&#31243;&#28216;&#25103;&#12305;&#36154;&#23681;&#25918;&#31036;&#33457;&#12290;&#65288;&#28857;&#29123;&#32493;&#24086;2-8&#27004;wcwtitxu&#30340;&#28976;&#28779;&#65289;</font></a>&#8221; &#23601;&#26159;&#25105;&#25237;&#30340;&#12290;<br />&#36816;&#34892;&#36215;&#26469;&#65292;&#25191;&#34892;&#25928;&#29575;&#36739;&#20302;&#12290;&#36824;&#24471;&#22810;&#23398;&#23398;...<br /><a href='http://www.ialvin.cn/Fireworks.htm' target='_blank'><u><font color='Blue'>&#25928;&#26524;&#39044;&#35272;</font></u></a><br />&#20195;&#30721;&#22914;&#19979;:<textarea name='code' class='js' cols='50'>&lt;html&gt;
&lt;head&gt;&lt;title&gt;&#26032;&#24180;&#24555;&#27138; &#33836;&#20107;&#22914;&#24847;&lt;/title&gt;
&lt;style&gt;
body{ background:#000; padding:0; margin:0; overflow:hidden; }
.ptr{ width:2px; height:2px; overflow:hidden; position: absolute; }
&lt;/style&gt;
&lt;script&gt;
function setColor(p) {
    p.r=Math.floor(p.r/2); p.g=Math.floor(p.g/2); p.b=Math.floor(p.b/2);
    if (p.r==0 &amp;&amp; p.g==0 &amp;&amp; p.b==0) return document.body.removeChild(p.ptr);
    p.ptr.style.background = &quot;rgb(&quot;+p.r+&quot;,&quot;+p.g+&quot;,&quot;+p.b+&quot;)&quot;;
    setTimeout(function(){setColor(p);}, 150);
}
function Point(x, y, r, g, b) {
    this.ptr = document.createElement(&quot;DIV&quot;);
    this.ptr.className = &quot;ptr&quot;;
    document.body.appendChild(this.ptr);
    this.ptr.style.left = x + &quot;px&quot;;
    this.ptr.style.top  = y + &quot;px&quot;;
    this.r = 2*r;
    this.g = 2*g;
    this.b = 2*b;
    var p = this;
    setTimeout(function(){setColor(p)}, Math.random()*200);
}
function Firework(mx, my) {
    this.mx = mx;
    this.my = my;
    this.cy=document.body.clientHeight||document.documentElement.clientHeight;
}
Firework.prototype.fire = function() {
    if (this.cy &lt;= this.my) return this.expansion();
    new Point(this.mx, this.cy, 0x40, 0x40, 0x40);
    this.cy -= 10;
    var self = this;
    setTimeout(function(){self.fire();}, 50);
};
Firework.prototype.init = function() {
    this.fs = [];
    var r1 = Math.random()*256;
    var g1 = Math.random()*256;
    var b1 = Math.random()*256;
    for (var x=0; x&lt;20; x++) {
        var o = {r:r1,g:g1,b:b1};
        var d = Math.random() * 6.283;
        var d1 = Math.random();
        o.vx = Math.sin(d) * d1 * 8;
        o.vy = Math.cos(d) * d1 * 8;
        o.l = Math.floor(Math.random() * 5) + 5;
        this.fs[x] = o;
        o.x = this.mx;
        o.y = this.my;
    }
};
Firework.prototype.expansion = function() {
    if (!this.fs) this.init();
    for (var x=0; x&lt;20; x++) {
        var o = this.fs[x];
        if (o===null) continue;
        if (o.l &lt; 0) {
            this.fs[x] = null;
            continue;
        }
        o.vy += 0.03;
        o.x += o.vx;
        o.y += o.vy;
        o.l -= 1;
        new Point(o.x, o.y, o.r, o.g, o.b);
    }
    var me = this;
    setTimeout(function() { me.expansion(); }, 100);
};
window.onload = function() {
    if (Math.random() &lt; 0.3) {
      var h=document.body.clientHeight||document.documentElement.clientHeight;
      var w=document.body.clientWidth||document.documentElement.clientWidth;
      new Firework(0.2*w+0.6*w*Math.random(),h/2+30-h/2*Math.random()).fire();
    }
    setTimeout(arguments.callee, 500);
};
&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;</textarea>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=164</link><title><![CDATA[值得深思的三个问题]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[心情日志]]></category><pubDate>2008-12-23 21:03:02</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=164</guid><description><![CDATA[&#19978;&#35838;&#38047;&#21709;&#20102;&#65292;&#29677;&#20027;&#20219;&#26469;&#20102;&#65292;&#20294;&#20182;&#24182;&#27809;&#26377;&#24102;&#20070;&#12290;&#31449;&#22312;&#21488;&#19978;&#21322;&#22825;&#27809;&#26377;&#20986;&#22768;&#65292;&#21516;&#23398;&#20204;&#19968;&#36793;&#31505;&#19968;&#36793;&#35815;&#24322;&#22320;&#26395;&#30528;&#20182;&#12290;<br /><br />&#32769;&#24072;&#25195;&#35270;&#30528;&#21516;&#23398;&#65306;&#8220;&#36825;&#33410;&#35838;&#25105;&#20204;&#26469;&#35752;&#35770;&#19977;&#20010;&#38382;&#39064;&#12290;&#8221;<br />&#20182;&#38382;&#36947;&#65306;&#8220;<b>&#19990;&#30028;&#19978;&#31532;&#19968;&#39640;&#23792;&#26159;&#21738;&#24231;&#23665;&#65311;</b>&#8221;<br />&#22823;&#23478;&#21700;&#22530;&#22823;&#31505;&#22320;&#22238;&#31572;&#65306;&#8220;<b>&#29664;&#31302;&#26391;&#29595;&#23792;</b>&#65281;&#8221;<br />&#32769;&#24072;&#25509;&#30528;&#36861;&#38382;&#65306;&#8220;<b>&#31532;&#20108;&#39640;&#23792;&#21602;</b>&#65311;&#8221;<br />&#36825;&#19979;&#21516;&#23398;&#20204;&#38754;&#38754;&#30456;&#35281;&#65292;&#26080;&#20154;&#24212;&#22768;&#65292;<br />&#32769;&#24072;&#36716;&#36807;&#36523;&#65292;&#22312;&#40657;&#26495;&#19978;&#20889;&#19979;&#19968;&#21477;&#35805;&#65306;<b><u>&#23624;&#23621;&#31532;&#20108;&#19982;&#40664;&#40664;&#26080;&#38395;&#27627;&#26080;&#21306;&#21035;</u></b>&#12290;<br /><br />&#32769;&#24072;&#39039;&#20102;&#39039;&#65292;&#35828;&#65306;&#8220;&#22909;&#20102;&#65292;&#19979;&#38754;&#25105;&#20204;&#26469;&#30475;&#31532;&#20108;&#38382;&#39064;&#12290;<b>&#26377;&#20010;&#20154;&#28903;&#22774;&#24320;&#27700;&#65292;&#21487;&#26159;&#31561;&#20182;&#29983;&#22909;&#28779;&#25165;&#21457;&#29616;&#26612;&#28779;&#21487;&#33021;&#19981;&#22815;&#65292;&#20182;&#35813;&#24590;&#20040;&#21150;</b>&#65311;&#8221;<br />&#21516;&#23398;&#20204;&#35758;&#35770;&#32439;&#32439;&#65292;&#20294;&#24847;&#35265;&#37117;&#36235;&#21516;&#20110;&#36214;&#24555;&#21435;&#25214;&#26612;&#28779;&#65292;&#25110;&#35828;&#21435;&#20511;&#65292;&#25110;&#35828;&#21435;&#20080;&#12290;<br />&#21487;&#32769;&#24072;&#37117;&#19981;&#32622;&#21487;&#21542;&#65292;&#20182;&#35828;&#65306;&#8220;<b><u>&#20026;&#20160;&#20040;&#19981;&#25226;&#33590;&#22774;&#37324;&#30340;&#27700;&#20498;&#25481;&#19968;&#20123;&#21602;</u></b>&#65311;&#8221;<br />&#21516;&#23398;&#20204;&#19968;&#21548;&#65292;&#19968;&#29255;&#20329;&#26381;&#22768;&#12290;<br /><br />&#25509;&#19979;&#26469;&#65292;&#32769;&#24072;&#21448;&#35828;&#20986;&#20102;&#31532;&#19977;&#20010;&#38382;&#39064;&#65306;&#8220;&#25105;&#22269;<b>&#21476;&#20195;&#26377;&#19968;&#20010;&#20154;&#65292;&#24819;&#23398;&#22909;&#19968;&#38376;&#31435;&#36523;&#30340;&#26412;&#39046;&#12290;&#20182;&#26366;&#32463;&#21453;&#22797;&#30340;&#27604;&#36739;&#65292;&#20915;&#24515;&#21435;&#23398;&#23648;&#40857;&#20043;&#25216;&#12290;&#20110;&#26159;&#65292;&#20182;&#25308;&#21517;&#24072;&#65292;&#26085;&#22812;&#33510;&#32451;&#65292;&#32456;&#20110;&#26377;&#25152;&#25104;&#12290;&#22823;&#23478;&#35828;&#20182;&#20250;&#24590;&#20040;&#26679;&#21602;</b>&#65311;&#8221;<br />&#21516;&#23398;&#20204;&#20852;&#33268;&#21187;&#21187;&#65292;&#35828;&#20182;&#32943;&#23450;&#33021;&#25104;&#20026;&#33521;&#38596;&#12289;&#26126;&#26143;&#65292;&#21463;&#19990;&#20154;&#23815;&#25308;&#12290;&#26377;&#30340;&#36824;&#26049;&#24449;&#21338;&#24341;&#12290;<br />&#32769;&#24072;&#36234;&#21548;&#36234;&#25671;&#22836;&#65292;&#20182;&#65306;&#8220;<b><u>&#36825;&#20010;&#20154;&#19968;&#23450;&#20250;&#31351;&#33510;&#28518;&#20498;&#19968;&#29983;&#65292;&#22240;&#20026;&#19990;&#19978;&#26681;&#26412;&#23601;&#27809;&#26377;&#40857;</u></b>&#12290;&#8221;<br /><br />&#32463;&#36807;&#32769;&#24072;&#19968;&#33410;&#35838;&#30340;&#24490;&#24490;&#21892;&#35825;&#65292;&#22823;&#23478;&#32456;&#20110;&#26126;&#30333;&#65292;&#21407;&#26469;&#36825;&#33410;&#35838;&#32769;&#24072;&#35201;&#21578;&#35785;&#25105;&#20204;&#30340;&#26159;&#20570;&#20154;&#12289;&#20570;&#20107;&#12289;&#20570;&#23398;&#38382;&#30340;&#36947;&#29702;&#12290;<br />&#37027;&#23601;&#26159;&#20570;&#20154;&#35201;&#21147;&#27714;&#20986;&#33394;&#65292;&#21191;&#20105;&#31532;&#19968;&#65292;&#36825;&#26679;&#21035;&#20154;&#25165;&#33021;&#21457;&#29616;&#20320;&#12289;&#35760;&#20303;&#20320;;<br />&#20570;&#20107;&#35201;&#25954;&#20110;&#21019;&#26032;&#65292;&#26041;&#27861;&#28789;&#27963;&#65292;&#21315;&#19975;&#19981;&#21487;&#22696;&#23432;&#25104;&#35268;;<br />&#20570;&#23398;&#38382;&#35201;&#23398;&#20197;&#33268;&#29992;&#65292;&#33021;&#23558;&#30693;&#35782;&#36716;&#21270;&#25928;&#30410;&#65292;&#38381;&#38376;&#36896;&#36710;&#26159;&#27809;&#26377;&#20986;&#36335;&#30340;&#12290;<br /><br />&#30340;&#30830;&#65292;&#36825;&#33410;&#35838;&#65292;&#35753;&#25105;&#20204;&#25152;&#26377;&#30340;&#20154;&#21463;&#30410;&#32456;&#29983;&#12290;<br />]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=162</link><title><![CDATA[ArcIMS HTML Viewer 中获取地图比例]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[网络开发]]></category><pubDate>2008-11-11 22:45:21</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=162</guid><description><![CDATA[&#36825;&#20960;&#22825;&#34987;&#36825;&#20010;&#38382;&#39064;&#21345;&#24456;&#20037;&#20102;&#12290;&#26368;&#21518;&#25165;&#21457;&#29616;&#21407;&#26469; IMS &#37324;&#30340;&#22352;&#26631;&#26159;&#32463;&#32428;&#24230;&#12290;<br /><textarea name='code' class='js' cols='50'>function getMapScale() {
	var y = Math.abs(miny + maxy) / 2;&#12288;// &#21462;&#22320;&#22270;&#20013;&#24515;&#28857;&#32428;&#24230;
	var r = Math.cos(Math.PI * y / 180) * 6378137; // &#27714;&#20986;&#32428;&#22280;&#21322;&#24452;
	var W = Math.PI * r * (maxx - minx) / 180; // &#30001;&#32463;&#32447;&#22841;&#35282;&#31639;&#20986;&#22270;&#29255;&#27700;&#24179;&#26041;&#21521;&#23454;&#38469;&#36317;&#31163;

	// imageWidth-&#22270;&#29255;&#23485;&#24230;(&#20687;&#32032;) 
	// 150-&#27604;&#20363;&#23610;&#23485;(&#20687;&#32032;)
	return Math.round(W * 150 / imageWidth);
}</textarea>&#36825;&#26679;&#24471;&#21040;&#30340;&#27604;&#20363;&#20540;&#23454;&#38469;&#19978;&#36824;&#26159;&#26377;&#28857;&#35823;&#24046;&#65292;&#20294;&#35823;&#24046;&#19981;&#22823;&#20102;&#12290;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=161</link><title><![CDATA[本博客程序下载]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[我的习作]]></category><pubDate>2008-11-08 02:58:21</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=161</guid><description><![CDATA[&#23601;&#26159;&#29616;&#22312;&#20320;&#30475;&#21040;&#30340;&#21338;&#23458;&#20102;&#65292;&#33258;&#24049;&#20889;&#20102;&#24456;&#20037;&#30340;&#12290;<br />&#19968;&#20123;&#21151;&#33021;&#27169;&#20223; PJBlog<br />&#29609;&#29609;&#36824;&#34892;&#65292;&#23454;&#38469;&#20351;&#29992;&#36824;&#26159;&#26377;&#32570;&#38519;&#12290;<br /><br />JScript &#20889;&#30340; ASP, &#39029;&#38754;&#26159; XML+XSLT<br /><br />&#19981;&#36807;&#22240;&#20026;&#26159;&#33258;&#24049;&#20889;&#30340;&#65292;&#19981;&#31649;&#22810;&#28866;&#65292;&#33258;&#24049;&#20063;&#37117;&#20250;&#20351;&#29992;&#65292;&#21621;&#21621;<br /><br />&#19979;&#36733;&#22320;&#22336;&#65306;http://www.blogjava.net/Files/alvin/ABlog.rar<br /><br />&#22914;&#26524;&#21457;&#29616;&#23433;&#20840;&#28431;&#27934;&#20160;&#20040;&#30340;&#65292;&#24076;&#26395;&#33021;&#22815;&#21453;&#39304;&#32473;&#25105;&#12290;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=160</link><title><![CDATA[08.10.21]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[心情日志]]></category><pubDate>2008-10-21 03:57:19</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=160</guid><description><![CDATA[&#22238;&#21040;&#23398;&#26657;&#21518;&#23601;&#19968;&#30452;&#36807;&#30528;&#32435;&#38391;&#30340;&#26085;&#23376;&#65292;&#20160;&#20040;&#21407;&#22240;&#23601;&#19981;&#25199;&#20102;&#12290;<br />&#31354;&#38388;&#22312; 09-18 &#31361;&#28982;&#34987;&#33707;&#21517;&#20854;&#22937;&#30340;&#20572;&#25481;&#65292;&#26381;&#21153;&#21830;&#32473;&#19981;&#20986;&#21512;&#29702;&#30340;&#35299;&#37322;&#65292;&#20063;&#19968;&#30452;&#27809;&#26377;&#24674;&#22797;&#12290;<br />&#36825;&#27573;&#26102;&#38388;&#65292;&#26159;&#22825;&#22825;&#29006;&#29100;&#21834;<br />&#25302;&#21040;&#20170;&#22825;&#24635;&#31639;&#25226;&#20027;&#35201;&#30340;&#19968;&#20123;&#19996;&#35199;&#21448;&#32473;&#37096;&#32626;&#19978;&#21435;&#20102;&#12290;<br /><br />&#39640;&#20013;&#30340;&#24072;&#22992;&#35828;&#24110;&#22905;&#20889;&#19968;&#22871;&#31243;&#24207;&#65292;&#26469;&#23398;&#26657;&#21518;&#23601;&#19968;&#30452;&#36214;&#30528;&#20889;&#20102;&#20010;&#31616;&#21333; XML+XSLT &#30340;&#12290;&#33258;&#24049;&#20063;&#39034;&#20415;&#25226;&#21338;&#23458;&#31243;&#24207;&#32473;&#25442;&#20102;&#65292;&#30475;&#19981;&#20986;&#26469;&#21543;&#65292;&#36824;&#29992; Jinn Lynn &#30340;&#32511;&#33394;&#30382;&#32932;&#65292;&#30475;&#36215;&#26469;&#23601;&#36319;&#20197;&#21069;&#30340;&#19968;&#27169;&#19968;&#26679;&#12290;&#26597;&#30475;&#39029;&#38754;&#28304;&#25991;&#20214;&#23601;&#33021;&#21457;&#29616;&#19981;&#21516;&#20102;&#12290;<br />&#20197;&#21069;&#21338;&#23458;&#30340;&#20449;&#24687;&#20063;&#36716;&#20102;&#36807;&#26469;&#65292;&#19981;&#36807;&#20250;&#21592;&#20449;&#24687;&#23601;&#20840;&#37117;&#27809;&#20102;<br />&#31243;&#24207;&#26159;&#33258;&#24049;&#20889;&#30340;&#20102;&#65292;&#31561;&#23436;&#21892;&#19968;&#19979;&#65292;&#21487;&#33021;&#36807;&#27573;&#26102;&#38388;&#20250;&#25226;&#20195;&#30721;&#25918;&#20986;&#26469;&#65292;&#25918;&#20986;&#26469;&#25165;&#23481;&#26131;&#21457;&#29616;&#38382;&#39064;&#65292;&#26377;&#21161;&#20110;&#23398;&#20064; ^_^]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=157</link><title><![CDATA[08.09.05 牢骚]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[心情日志]]></category><pubDate>2008-09-05 15:51:10</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=157</guid><description><![CDATA[&#12288;&#12288;&#21448;&#22238;&#21040;&#23398;&#26657;&#20102;&#65292;&#32487;&#32493;&#19981;&#29245;&#21679;&#12290;<br />&#12288;&#12288;&#25105;&#30340;&#22478;&#38498;&#29983;&#27963;&#65292;&#24590;&#20040;&#34920;&#36798;&#21602;&#65292;&#20511;&#29992;&#19968;&#19979; JavaScript &#21543;&#65306;<br /><textarea name='code' class='js' cols='50'>window.alert(/^[^&#21916;&#20048;]+$/.test(&#25105;&#30340;&#22478;&#38498;&#29983;&#27963;));</textarea><br />&#12288;&#12288;&#21769;&#65292;&#26159; &quot;<font color='Red'>true</font>&quot;&#12290;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=156</link><title><![CDATA[自动识别URI使用的编码(gbk/utf-8)并正确解码[ASP]]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[网络开发]]></category><pubDate>2008-07-31 20:23:20</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=156</guid><description><![CDATA[&#21069;&#22825;&#22312; CSDN &#26377;&#32593;&#21451;&#38382;&#21040; ASP &#20013; UTF-8 &#36716; GB2312 &#30340;&#38382;&#39064;<br />&#35265;:http://topic.csdn.net/u/20080729/18/b257b0ce-d947-495d-a722-00b8b6a577dc.html<br /><br />&#20351;&#29992;&#30340;&#26159;&#32593;&#19978;&#27969;&#34892;&#30340;　UTF2GB(UTFStr) &#20989;&#25968;&#12290;<br />&#20195;&#30721;&#29978;&#26159;&#22797;&#26434;&#65292;&#20294;&#20854;&#23454;&#30446;&#30340;&#26159;&#20026;&#20102;&#23454;&#29616; JScript &#37324; decodeURIComponent &#21151;&#33021;&#12290;<br />&#25105;&#24456;&#26159;&#37057;&#38391;&#65292;&#26082;&#28982; JScript &#26377; decodeURIComponent&#65292;&#32780;&#19988; ASP &#21448;&#21487;&#20197;&#20351;&#29992; JScript &#20026;&#20160;&#20040;&#29616;&#25104;&#30340;&#20869;&#32622;&#20989;&#25968;&#19981;&#29992;&#21602;&#65311;&#22914;&#65306;<br /><textarea name='code' class='xml' cols='50'>&lt;script language=&quot;JScript&quot; runat=&quot;Server&quot;&gt;
function decodeURL(s) { return decodeURIComponent(s) }
&lt;/script&gt;
&lt;%
Response.Write decodeURL(&quot;%E6%8A%9A%E9%A1%BA%E9%9D%92%E6%9D%BE%E8%8D%AF%E4%B8%9A&quot;)
%&gt;</textarea><br /><br />&#21487;&#33021;&#26377;&#20123;&#26379;&#21451;&#23601;&#29305;&#19981;&#21916;&#27426; JScript, &#37027;&#20040;&#21033;&#29992;&#19968;&#19979; ADODB.Stream &#36716;&#30721;&#20063;&#26041;&#20415;&#30340;&#22810;<br /><textarea name='code' class='vb' cols='50'>Function UTF2GB(s)   
    Dim sm   
    Set sm = Server.CreateObject(&quot;ADODB.Stream&quot;)   
    With sm   
        .Type = 2   
        .Mode = 3   
        .Open   
        .CharSet = &quot;iso-8859-1&quot;  
        .WriteText UnEscape(s) ' &#20351;&#29992; unescape &#35299;&#30721;&#25104; iso-8859-1 &#20018;&#21518; &#21033;&#29992; ADODB.Stream &#36716;&#25442;&#32534;&#30721;   
        .Position = 0   
        .CharSet = &quot;UTF-8&quot;  
        UTF2GB = .ReadText(-1)   
        .Close   
    End With  
    Set sm = Nothing  
End Function  
  
Response.Write UTF2GB(&quot;%E6%8A%9A%E9%A1%BA%E9%9D%92%E6%9D%BE%E8%8D%AF%E4%B8%9A&quot;)</textarea><br />^_^ &#19978;&#38754;&#35828;&#20102;&#36825;&#20040;&#22810;&#65292;&#37117;&#36319;&#20027;&#39064;&#27809;&#20160;&#20040;&#20851;&#31995;<br /><br />&#22312;&#21407;&#26469;&#36148;&#23376;&#20013;&#65292;&#25552;&#38382;&#30340;&#32593;&#21451;&#26368;&#21518;&#25552;&#21040;&#20102;&#19968;&#20010;&#24456;&#22909;&#30340;&#38382;&#39064;&#12290;<br />&#23601;&#26159;&#20687;: <br />&quot;&#25242;&#39034;&#38738;&#26494;&#33647;&#19994;&quot;<br />GBK &#30340; URI &#32534;&#30721;&#26159; <font color='Red'>&quot;%B8%A7%CB%B3%C7%E0%CB%C9%D2%A9%D2%B5&quot;</font><br />UTF-8 &#30340; URI &#32534;&#30721;&#26159; <font color='Green'>&quot;%E6%8A%9A%E9%A1%BA%E9%9D%92%E6%9D%BE%E8%8D%AF%E4%B8%9A&quot;</font><br /><br />&#22312;&#26410;&#30693;&#20309;&#31181;&#32534;&#30721;&#26684;&#24335;&#30340;&#24773;&#20917;&#19979;&#65292;&#22914;&#20309;&#33021;&#33258;&#21160;&#35782;&#21035;&#20854;&#32534;&#30721;&#65292;&#27491;&#30830;&#35299;&#20986; &quot;&#25242;&#39034;&#38738;&#26494;&#33647;&#19994;&quot; (Google &#23601;&#33021;&#20570;&#21040;)<br /><br />&#36825;&#20010;&#38382;&#39064;&#20043;&#21069;&#33258;&#24049;&#20063;&#26377;&#34987;&#38590;&#20303;&#36807;&#65292;&#37027;&#26102;&#20505;&#26159;&#20570;&#39029;&#38754;&#32479;&#35745;&#26102;&#65292;&#20026;&#20102;&#20998;&#26512;&#29992;&#25143;&#20174;&#25628;&#32034;&#24341;&#25806;&#36827;&#20837;&#26102;&#65292;&#29992;&#25143;&#25628;&#30340;&#26159;&#20160;&#20040;&#20851;&#38190;&#23383;&#65292;&#36825;&#23601;&#38656;&#35201;&#20174;&#26469;&#36335;&#39029;&#38754;&#30340;&#22320;&#22336;&#20013;&#20998;&#26512;&#20986;&#20851;&#38190;&#23383;&#65292;&#32780; &#25552;&#20132;&#32473; Google &#30340;&#25628;&#32034;&#20851;&#38190;&#23383;&#26377;&#26102;&#26159; GBK &#30340; URI &#32534;&#30721;&#65292;&#26377;&#26102;&#26159; UTF-8 &#30340; URI &#32534;&#30721;&#12290;&#36825;&#23601;&#35201;&#27714;&#25105;&#20204;&#20063;&#24517;&#39035;&#33021;&#20687; Google &#19968;&#26679;&#33021;&#35782;&#21035;&#20986; URI &#20018;&#26159;&#29992;&#20102;&#20160;&#20040;&#32534;&#30721;&#12290;<br /><br />&#22312;&#25628;&#32034;&#20102; UTF-8 &#30340;&#32534;&#30721;&#35268;&#21017;&#21518;&#65292;&#32456;&#20110;&#20889;&#20986;&#20102;&#19979;&#38754;&#30340;&#20195;&#30721;<br /><textarea name='code' class='vb' cols='50'>Function DecodeURI(ByVal s)   
    s = UnEscape(s)   
    Dim reg, cs   
    cs = &quot;GBK&quot;  
    Set reg = New RegExp   
    reg.Pattern = &quot;^(?:[\x00-\x7f]|[\xfc-\xff][\x80-\xbf]{5}|[\xf8-\xfb][\x80-\xbf]{4}|[\xf0-\xf7][\x80-\xbf]{3}|[\xe0-\xef][\x80-\xbf]{2}|[\xc0-\xdf][\x80-\xbf])+$&quot;  
    If reg.Test(s) Then cs = &quot;UTF-8&quot;  
    Set reg = Nothing  
    Dim sm   
    Set sm = CreateObject(&quot;ADODB.Stream&quot;)   
    With sm   
        .Type = 2   
        .Mode = 3   
        .Open   
        .CharSet = &quot;iso-8859-1&quot;  
        .WriteText s   
        .Position = 0   
        .CharSet = cs   
        DecodeURI = .ReadText(-1)   
        .Close   
    End With  
    Set sm = Nothing  
End Function  

Response.Write DecodeURI(&quot;%B8%A7%CB%B3%C7%E0%CB%C9%D2%A9%D2%B5&quot;)
Response.Write DecodeURI(&quot;%E6%8A%9A%E9%A1%BA%E9%9D%92%E6%9D%BE%E8%8D%AF%E4%B8%9A&quot;)</textarea><br />&#20598;&#23572;&#20063;&#20250;&#26377; GBK &#32534;&#30721;&#20018;&#34987;&#35823;&#35748;&#20026; UTF-8 &#30340;&#65292;&#19981;&#36807;&#65292;&#35823;&#35748;&#30340;&#38382;&#39064;&#24182;&#19981;&#22909;&#35299;&#20915;&#65292;Google &#37117;&#20063;&#20250;&#20986;&#36825;&#26679;&#30340;&#38382;&#39064;&#12290;<br />&#25226;&#20195;&#30721;&#35760;&#19979;&#26469;&#65292;&#22791;&#20197;&#21518;&#29992; ]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=155</link><title><![CDATA[放假回家了]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[心情日志]]></category><pubDate>2008-07-12 03:39:25</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=155</guid><description><![CDATA[&#25918;&#20551;&#22238;&#23478;&#20102;, &#21338;&#23458;&#24403;&#28982;&#23601;&#26242;&#20572;&#26356;&#26032;&#20102;.<br />&#20854;&#23454;,&#19981;&#22238;&#23478;&#20063;&#24456;&#21487;&#33021;&#19981;&#26356;&#26032;..^_^<br /><br />&#23398;&#26657;&#30495;&#37057;&#38391;, &#26257;&#20551;&#19981;&#32473;&#23398;&#29983;&#30041;&#23487;.&#27735; ]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=154</link><title><![CDATA[[分享]封装了个 WSC 脚本组件(ASP 下的 PreparedStatement)]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[我的习作]]></category><pubDate>2008-07-05 13:30:00</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=154</guid><description><![CDATA[&#38450;&#27880;&#20837;&#19968;&#30452;&#26159; ASP &#30340;&#36719;&#32907;, &#25105;&#20204;&#37117;&#30693;&#36947;&#22312; Java &#20013;&#35775;&#38382;&#25968;&#25454;&#24211;&#26377; PreparedStatement&#12290;&#36825;&#22312; JSP &#20013;&#35775;&#38382;&#25968;&#25454;&#24211;&#26102;&#38450; SQL &#27880;&#20837;&#25552;&#20379;&#20102;&#24456;&#22823;&#26041;&#20415;&#12290;<br />&#22312; ASP &#20013;&#35201;&#20063;&#26377;&#36825;&#20040;&#20010;&#19996;&#19996;&#23601;&#22909;&#20102;&#12290;ASP &#19968;&#33324;&#37117;&#36890;&#36807; ADODB &#32452;&#20214;&#35775;&#38382;&#25968;&#25454;&#24211;&#30340;&#65292;&#20854;&#23454; ADODB.Command &#23601;&#26377; Prepared &#30340;&#21151;&#33021;&#12290;&#26089;&#19978;&#27809;&#20107;&#24178;&#23601;&#23553;&#35013;&#20102;&#19968;&#19979;&#65292;&#20570;&#25104; WSC &#33050;&#26412;&#32452;&#20214;&#30340;&#24418;&#24335;&#12290;&#20197;&#26041;&#20415;&#20197;&#21518;&#30340;&#20351;&#29992;&#12290;<br />&#19979;&#38754;&#26159; Connection.WSC &#30340;&#20195;&#30721;&#65306;&#65288;&#20195;&#30721;&#20197;&#25991;&#26412;&#24418;&#24335;&#20445;&#23384;&#20026; Connection.WSC &#23601;&#21487;&#20197;&#20102;&#65289;<br /><textarea name='code' class='VB' cols='50'>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;?component error=&quot;0&quot; debug=&quot;0&quot; ?&gt;
&lt;component&gt;
  &lt;comment&gt;Alvin(ialvin.cn)&lt;/comment&gt;
  &lt;registration description=&quot;Connection&quot; progid=&quot;ALIB.Connection&quot; version=&quot;1.00&quot; remotable=&quot;true&quot;
	classid=&quot;{46dac711-0b77-43b2-b195-1ee912dcb322}&quot;&gt;&lt;/registration&gt;
  &lt;public&gt;
	&lt;property name=&quot;Count&quot;&gt;&lt;get/&gt;&lt;/property&gt;
	&lt;property name=&quot;ActiveConnection&quot;&gt;&lt;get/&gt;&lt;/property&gt;
	&lt;property name=&quot;ConnectionString&quot;&gt;&lt;get/&gt;&lt;put/&gt;&lt;/property&gt;

	&lt;method name=&quot;Prepare&quot;&gt;&lt;PARAMETER name=&quot;sql&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;ResetParam&quot;&gt;&lt;/method&gt;
	&lt;method name=&quot;Open&quot;&gt;&lt;/method&gt;
	&lt;method name=&quot;Execute&quot;&gt;&lt;/method&gt;
	&lt;method name=&quot;QueryS&quot;&gt;&lt;/method&gt;
	&lt;method name=&quot;Query&quot;&gt;&lt;PARAMETER name=&quot;cursorType&quot;/&gt;&lt;PARAMETER name=&quot;lockType&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;OpenRS&quot;&gt;&lt;PARAMETER name=&quot;rs&quot;/&gt;&lt;PARAMETER name=&quot;cursorType&quot;/&gt;&lt;PARAMETER name=&quot;lockType&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;EncodeLike&quot;&gt;&lt;PARAMETER name=&quot;str&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;SetNull&quot;&gt;&lt;/method&gt;
	&lt;method name=&quot;SetInt&quot;&gt;&lt;PARAMETER name=&quot;num&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;SetFloat&quot;&gt;&lt;PARAMETER name=&quot;num&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;SetString&quot;&gt;&lt;PARAMETER name=&quot;str&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;SetBinary&quot;&gt;&lt;PARAMETER name=&quot;bits&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;SetBoolean&quot;&gt;&lt;PARAMETER name=&quot;bln&quot;/&gt;&lt;/method&gt;
	&lt;method name=&quot;SetDateTime&quot;&gt;&lt;PARAMETER name=&quot;dt&quot;/&gt;&lt;/method&gt;
  &lt;/public&gt;
  &lt;object progid=&quot;ADODB.Command&quot; id='oCMD'/&gt;
  &lt;object progid=&quot;ADODB.RecordSet&quot; id='oRS'/&gt;
  &lt;implements type=&quot;ASP&quot; id=&quot;ASP&quot;/&gt;
&lt;script language=&quot;VBScript&quot;&gt;&lt;![CDATA[
Dim coxn: Set coxn = New Connection
Class Connection
	Private conn, coxnStr, cnt, opened

	Public Property Get ActiveConnection()
		Set ActiveConnection = conn
	End Property

	Public Property Get Count()
		Count = cnt
	End Property

	Public Property Get ConnectionString()
		ConnectionString = coxnStr
	End Property

	Public Property Let ConnectionString(ByVal newValue)
		coxnStr = newValue
	End Property

	Private Sub Class_Initialize()
		cnt = 0
		opened = False
	End Sub

	Public Sub OpenConnection()
		Set conn = CreateObject(&quot;ADODB.Connection&quot;)
		conn.Open coxnStr
		oCMD.Prepared = True
		oCMD.CommandType = 1
		Set oCMD.ActiveConnection = conn
		opened = True
	End Sub

	Public Sub Prepare(ByVal sql)
		If Not opened Then Call OpenConnection()
		Call ResetParam()
		oCMD.CommandText = sql
	End Sub

	Public Sub AppendParameter(ByVal value, ByVal dataType)
		Dim param: Set param = oCMD.CreateParameter()
		param.Type = dataType
		param.Value = value
		param.Direction = 1
		Call oCMD.Parameters.Append(param)
	End Sub

	Public Function Execute()
		Set Execute = oCMD.Execute()
		cnt = cnt + 1
	End Function

	Public Sub OpenRS(ByRef rs, ByVal cursorType, ByVal lockType)
		rs.CursorType = cursorType
		rs.LockType = lockType
		Call rs.Open(oCMD)
		cnt = cnt + 1
	End Sub

	Public Sub ResetParam()
		While oCMD.Parameters.Count &gt; 0
			oCMD.Parameters.Delete 0
		Wend
	End Sub

	Private Sub Class_Terminate()
		If IsObject(conn) Then
			If conn.State=1 Then Call conn.Close()
			Set conn = Nothing
		End If
	End Sub
End Class

Function get_ConnectionString()
	get_ConnectionString = coxn.ConnectionString
End Function

Function put_ConnectionString(newValue)
	coxn.ConnectionString = newValue
End Function

Function get_ActiveConnection()
	Set get_ConnectionString = coxn.ActiveConnection
End Function

Function get_Count()
	get_Count = coxn.Count
End Function

Function Prepare(ByVal sql)
	Call coxn.Prepare(sql)
End Function

Function SetInt(ByVal num)
	Call coxn.AppendParameter(num, 3)
End Function

Function SetFloat(ByVal num)
	Call coxn.AppendParameter(num, 4)
End Function

Function SetString(ByVal str)
	Call coxn.AppendParameter(str, 8)
End Function

Function SetDateTime(ByVal dt)
	Call coxn.AppendParameter(dt, 135)
End Function

Function SetBoolean(ByVal bln)
	Call coxn.AppendParameter(bln, 11)
End Function

Function SetBinary(ByRef bits)
	Dim param
	Set param = oCMD.CreateParameter(&quot;&quot;, 205, &amp;H001, -1)
	Call param.AppendChunk(bits)
	Call oCmd.Parameters.Append(param)
	Set param = Nothing
End Function

Function SetNull()
	Call oCMD.Parameters.Append(oCMD.CreateParameter(&quot;&quot;, 200, &amp;H0001, 1, Null))
End Function

Function Open()
	Call coxn.OpenConnection()
End Function

Function Execute()
	Set Execute = coxn.Execute()
End Function

Function OpenRS(ByRef rs, ByVal cursorType, ByVal lockType)
	Call coxn.OpenRS(rs, cursorType, lockType)
End Function

Function Query(ByVal cursorType, ByVal lockType)
	Set Query = CreateObject(&quot;ADODB.RecordSet&quot;)
	Call OpenRS(Query, cursorType, lockType)
End Function

Function QueryS()
	QueryS = Null
	Call OpenRS(oRS, 0, 1)
	If oRS.State &lt;&gt; 1 Then Exit Function
	If Not oRS.EOF Then QueryS = oRS.Fields.Item(0).Value
	Call oRS.Close()
End Function

Function ResetParam()
	Call coxn.ResetParam()
End Function

Function EncodeLike(ByVal str)
	Dim regex: Set regex = New RegExp
	regex.Pattern = &quot;[\]\[`\-=\\;',./~!@#$%^&amp;*()_+|{}:&quot;&quot;&lt;&gt;?]&quot;
	regex.Global = True
	EncodeLike = regex.Replace(str, &quot;[$+]&quot;)
	Set regex = Nothing
End Function
]]&gt;&lt;/script&gt;
&lt;/component&gt;</textarea><br />&#36825;&#26159;&#19968;&#20010;&#33050;&#26412;&#65292;&#20294;&#23427;&#21364;&#26159;&#19968;&#20010;&#19981;&#25240;&#19981;&#25187;&#30340; ActiveX &#32452;&#20214;&#20102;&#12290;<br />&#20445;&#23384;&#25104; Connection.WSC &#21518;&#65292;&#21491;&#38190;&#33756;&#21333;&#21487;&#20197;&#36873;&#25321;&#27880;&#20876;&#21644;&#27880;&#38144;&#12290;<br /><br />&#20351;&#29992;&#26041;&#27861;&#65306;<br /><textarea name='code' class='VB' cols='50'>
&lt;%
Dim coxn, rs, connStr
connStr = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; Server.MapPath(&quot;data.mdb&quot;)

' &#21019;&#24314;&#23545;&#35937; (&#26080;&#27880;&#20876;&#32452;&#20214;) ---------------------
Set coxn = GetObject(&quot;script:&quot; &amp; Server.MapPath(&quot;Connection.WSC&quot;)) 
coxn.ConnectionString = connStr
' ...
Set coxn = Nothing

' &#25110;&#32773; (&#38656;&#35201;&#27880;&#20876;&#32452;&#20214;) ----------------------
Set coxn = Server.CreateObject(&quot;ALIB.Connection&quot;) ' 
coxn.ConnectionString = connStr
'...
Set coxn = Nothing
%&gt;
</textarea><br /><textarea name='code' class='VB' cols='50'>
' &#25191;&#34892;&#26080;&#36820;&#22238;&#32467;&#26524;&#30340; SQL
Call coxn.Prepare(&quot;Insert INTO [test] VALUES(?, ?, ?, ?, ?, ?, ?)&quot;)

Call coxn.SetInt(1)
Call coxn.SetFloat(106.56)
Call coxn.SetString(&quot;&#27979;&#35797;&quot;)
Call coxn.SetDateTime(Now())
Call coxn.SetNull()
Call coxn.SetBoolean(True)
Call coxn.SetBinary(bits) ' &#20108;&#36827;&#21046;&#25968;&#25454; [byte() &#25968;&#32452;]

Call coxn.Execute()
</textarea><br /><textarea name='code' class='VB' cols='50'>
'&#26597;&#35810;&#36820;&#22238;&#21807;&#19968;&#20540;&#30340; SQL 
coxn.Prepare &quot;SELECT Count(*) FROM [test] WHERE [id]&gt;? AND [title]=?&quot;

coxn.SetInt 10
coxn.SetString &quot;&#27979;&#35797;&quot;

result = coxn.QueryS() ' &#30452;&#25509;&#36820;&#22238;&#32467;&#26524;,&#32780;&#19981;&#26159; RecordSet
Response.Write result
</textarea><br /><textarea name='code' class='VB' cols='50'>
' &#26222;&#36890;&#26597;&#35810;
coxn.Prepare &quot;SELECT * FROM [test] WHERE [id]&gt;? AND [title]=?&quot;
coxn.SetInt 10
coxn.SetString &quot;&#27979;&#35797;&quot;

Set rs = coxn.Execute()
....
rs.Close
Set rs = Nothing
</textarea><br /><textarea name='code' class='VB' cols='50'>
' &#36820;&#22238;&#25351;&#23450;&#20102; CursorType&#12289;LockType &#30340; RecordSet
coxn.Prepare &quot;SELECT * FROM [test] WHERE [id]&gt;? AND [title]=?&quot;
coxn.SetInt 10
coxn.SetString &quot;&#27979;&#35797;&quot;

Set rs = coxn.Query(1, 1) ' coxn.Execute() &#30456;&#24403;&#20110; coxn.Query(0, 1)
....
rs.Close
Set rs = Nothing
</textarea><br /><textarea name='code' class='VB' cols='50'>' &#25171;&#24320;&#29616;&#26377;&#30340; RecordSet

' &#20808;&#24314;&#31435;&#20102; RecordSet
Set rs = Server.CreateObject(&quot;ADODB.RecordSet&quot;) 

coxn.Prepare &quot;SELECT * FROM [test] WHERE [id]&gt;? AND [title]=?&quot;
coxn.SetInt 10
coxn.SetString &quot;&#27979;&#35797;&quot;
Call coxn.OpenRS(rs, 1, 1) ' &#25171;&#24320; rs
' &#25805;&#20316; rs
' ...
Call rs.Close() '&#20851;&#38381; rs

Call coxn.Prepare(&quot;SELECT * FROM [test] WHERE 1=2&quot;)
Call coxn.OpenRS(rs, 1, 3) '&#20877;&#27425;&#25171;&#24320; rs
Call rs.AddNew()
rs(&quot;title&quot;) = &quot;&#27979;&#35797;2&quot;
Call rs.Update()
Call rs.Close() ' &#20851;&#38381; rs

Set rs = Nothing</textarea><br />&#22823;&#23478;&#22914;&#26524;&#21457;&#29616;&#26377;&#38382;&#39064;&#28431;&#27934;&#20160;&#20040;&#30340;&#27426;&#36814;&#30041;&#35328;&#21578;&#30693;&#65292;&#22823;&#23478;&#20063;&#21487;&#20197;&#33258;&#34892;&#23436;&#21892;&#19968;&#19979;&#12290;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=153</link><title><![CDATA[简易 JSP 论坛源码]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[我的习作]]></category><pubDate>2008-06-22 03:31:16</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=153</guid><description><![CDATA[&#21448;&#19968;&#20010;&#35838;&#31243;&#35774;&#35745; &#31616;&#21333;&#30340; JSP &#35770;&#22363;<br />&#21151;&#33021;&#36739;&#31616;&#21333;&#30340;&#37027;&#31181;, &#30028;&#38754;&#19978;&#27169;&#20223;&#20102; Discuz<br />JSP &#26412;&#26469;&#23601;&#23398;&#30340;&#19981;&#34892;, &#21482;&#26159;&#23613;&#37327;&#23454;&#29616;&#20102; MVC<br /><br />&#28304;&#30721;&#19979;&#36733;:http://www.blogjava.net/Files/alvin/bbs.rar<br /><img src='attachments/2008_10_14_23_32_05_28.jpg' border='0' /><br /><br /><font color='Red'>&#21518;&#26469;&#37324;&#38754;&#21457;&#29616;&#26377;&#36923;&#36753;&#19978;&#30340;&#38169;&#35823;,&#27809;&#26377;&#25913;&#36807;&#26469;</font>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=152</link><title><![CDATA[JavaScript 实现本地编码格式的 URLEncode]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[网络开发]]></category><pubDate>2008-06-14 13:51:51</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=152</guid><description><![CDATA[JavaScript &#37324;&#26377; escape, encodeURI &#21644; encodeURIComponent &#20989;&#25968;<br />&#37117;&#21487;&#20197;&#23545;&#23383;&#20018;&#36827;&#34892;&#32534;&#30721;,&#23427;&#20204;&#20043;&#38388;&#30340;&#24322;&#21516;,&#22312;&#27492;&#23601;&#19981;&#35828;&#20102;.<br /><br />&#26412;&#25991;&#26159;&#20026;&#20102;&#35299;&#20915;&#22312; JavaScript &#23545;&#25991;&#26412;&#36827;&#34892;&#26412;&#22320;&#32534;&#30721;&#26684;&#24335;&#30340; URI &#32534;&#30721;&#38382;&#39064;&#12290;<br />JS &#26412;&#36523;&#20351;&#29992;&#30340;&#23383;&#31526;&#32534;&#30721;&#26159; Unicode<br />escape &#20989;&#25968;&#20063;&#26159; Unicode &#30340;<br />encodeURI &#21644; encodeURIComponent &#21017;&#37117;&#26159; UTF-8 &#30340;&#12290;<br /><br />&#20294;&#25105;&#20204;&#26377;&#26102;&#21017;&#38656;&#35201;&#25353;&#26412;&#22320;&#32534;&#30721;&#26684;&#24335;&#23545;&#23383;&#31526;&#20018;&#36827;&#34892; URI &#32534;&#30721;&#12290;&#22914;&#65306;GB2312 &#30340;<br /><br />&#22914;&#26524;&#26159;&#22312; IE &#21487;&#20197;&#20511;&#21161; VBScript &#30340; Asc &#20989;&#25968;&#12290;&#20294;&#26159;&#22312;&#38750; IE &#27983;&#35272;&#22120;&#23601;&#19981;&#22909;&#21150;&#20102;&#12290;&#21040;&#24213;&#35201;&#24590;&#20040;&#26679;&#25165;&#33021;&#22815;&#36827;&#34892; GBK &#30340; URLEncode &#21602;&#65311;<br />&#20043;&#21069;&#30475;&#21040;&#19968;&#20010;&#26041;&#27861;&#23601;&#26159;&#22312; JS &#20013;&#21152;&#20837;&#19968;&#20010; Unicode-&gt;GB2312 &#30340;&#26144;&#23556;&#34920;&#65292;&#20063;&#26159;&#19968;&#20010;&#21150;&#27861;&#65292;&#20294;&#26159;&#35273;&#24471;&#21152;&#20102;&#20960;&#21313;&#65323;&#30340;&#19996;&#19996;&#65292;&#23383;&#31526;&#36824;&#19981;&#30693;&#36947;&#26159;&#19981;&#26159;&#24456;&#23436;&#25972;&#12290;<br /><br />&#20170;&#22825;&#31361;&#28982;&#24819;&#21040;&#20102;&#29992; Flash, &#22312; Flash &#21487;&#20197;&#22312; ActionScript &#20013;&#36890;&#36807; System.useCodepage = true &#35774;&#32622;&#20351;&#29992;&#26412;&#22320;&#32534;&#30721;&#12290;&#28982;&#21518;&#21033;&#29992; ExternalInterface &#32473; JS &#26333;&#20010;&#25509;&#21475;&#12290;JavaScript &#35843;&#29992; Flash &#30340;&#20989;&#25968;&#26469;&#23454;&#29616;&#12290;<br /><br />&#24605;&#36335;&#35273;&#24471;&#36824;&#19981;&#38169;&#65292;&#20110;&#26159;&#23601;&#27979;&#35797;&#20102;&#19968;&#19979;&#12290;<br /><br />&#22312; Flash8 &#20013;&#26032;&#24314;&#20010;&#31354;&#30333;&#25991;&#26723;&#12290;&#22312;&#20027;&#22330;&#26223;&#37324;&#21152;&#20102;&#19979;&#38754;&#21160;&#20316;&#20195;&#30721;&#65306;<br /><textarea name='code' class='js' cols='50'>import flash.external.ExternalInterface;   
System.useCodepage = true;   
stop();   
  
function encodeURL(str:String) {   
    return (escape(str)); // ActionScript &#30340; escape &#36319; JavaScript &#30340; escape &#26159;&#19981;&#19968;&#26679;&#30340;.   
}   
  
ExternalInterface.addCallback(&quot;encodeURL&quot;, this, encodeURL);</textarea><br />&#28982;&#21518;&#24314;&#20010; htm &#27979;&#35797;&#19979;<br /><textarea name='code' class='xml' cols='50'>&lt;script type=&quot;text/javascript&quot;&gt;//&lt;![CDATA[  
function thisMovie(movieName) {
    if (navigator.appName.indexOf(&quot;Microsoft&quot;) != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
}
function mDo() {
    alert(thisMovie(&quot;encURI&quot;).encodeURL(&quot;&#20013;&#22269;&#20154;&quot;));
}
//]]&gt;&lt;/script&gt;
&lt;object id=&quot;encURI&quot; classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0&quot; width=&quot;0&quot; height=&quot;0&quot;&gt;
&lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;
&lt;param name=&quot;movie&quot; value=&quot;encodeURL.swf&quot; /&gt;
&lt;embed name=&quot;encURI&quot; src=&quot;encodeURL.swf&quot; width=&quot;0&quot; height=&quot;0&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;  
&lt;/object&gt;
&lt;input type=&quot;button&quot; onclick=&quot;javascript:mDo()&quot; value=&quot; test &quot;&gt;</textarea><br /><br />&#27979;&#35797;&#39029;&#38754;: http://www.ialvin.cn/util/py.htm<br />&#26524;&#28982;&#25104;&#21151;&#20102;&#65281;<br />&#35273;&#24471;&#33258;&#24049;&#36825;&#20010;&#20027;&#24847;&#36824;&#26159;&#19981;&#38169;&#30340;&#12290;&#22079;&#22079;&#65281;]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=151</link><title><![CDATA[一个 ASP 班级网站源码]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[我的习作]]></category><pubDate>2008-05-24 02:02:45</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=151</guid><description><![CDATA[&#23398;&#26657;&#24320;&#20160;&#20040;&#32593;&#39029;&#35774;&#35745;&#22823;&#36187;.&#29677;&#38271;&#35828;&#29677;&#37324;&#35201;&#26377;&#20010;&#20316;&#21697;&#21442;&#36187;.<br />&#23601;&#22312;&#32593;&#19978;&#25628;&#20102;&#20123;&#36164;&#28304;&#25340;&#20945;&#19979;&#25630;&#20102;&#20010;&#12290;&#32452;&#20960;&#20010;&#21516;&#23398;&#20197;&#22242;&#38431;&#20316;&#21697;&#20132;&#19978;&#21435;.<br /><br />ASP+Access&#65292;&#26381;&#21153;&#22120;&#33050;&#26412;&#65306;JScript&#12290;<br />&#21069;&#21488;ASP&#36755;&#20986;&#30340;&#26159;XML&#30001;&#27983;&#35272;&#22120;&#19979;&#36733;XSLT&#26684;&#24335;&#25104;XHTML&#12290;<br /><img src='attachments/2008_10_14_23_08_07_27.jpg' border='0' /><br /><br />&#28304;&#30721;&#65306;<a href='http://www.blogjava.net/Files/alvin/js.rar' target='_blank'>http://www.blogjava.net/Files/alvin/js.rar</a>]]></description></item><item><link>http://www.ialvin.cn/blog/article.asp?id=150</link><title><![CDATA[Java 农历]]></title><author>78423497@qq.com(林志斌)</author><category><![CDATA[学习随笔]]></category><pubDate>2008-04-05 03:12:37</pubDate><guid>http://www.ialvin.cn/blog/article.asp?id=150</guid><description><![CDATA[&#19968;&#20010;&#35745;&#31639;&#20892;&#21382;&#30456;&#20851;&#20449;&#24687;&#30340; Java &#31867;.<br />&#19979;&#38754;&#26159;&#21033;&#29992;&#27492;&#31867;&#20570;&#30340;&#19968;&#20010;&#26376;&#21382;&#20363;&#23376;.<br /><img src='attachments/2008_10_14_23_05_43_25.jpg' border='0' /><br />&#28304;&#25991;&#20214;:<a href='attachments/2008_10_14_23_06_16_26.rar'><img src='editor/images/download.gif' style='margin:0px 2px -4px 0px' border='0' />点击下载</a>]]></description></item></channel></rss>
