<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[史考特部落格園地 - ASP]]></title>
<link>http://www.pro-soho.com/Blog/</link>
<description><![CDATA[生命就該浪費在美好的事物上]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog2 v2.4]]></copyright>
<webMaster><![CDATA[scooter.tw@gmail.com(Scott)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>史考特部落格園地</title> 
	<url>http://www.pro-soho.com/Blog/images/logos.gif</url> 
	<link>http://www.pro-soho.com/Blog/</link> 
	<description>史考特部落格園地</description> 
</image>

			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=295</link>
			<title><![CDATA[實現透過CDO.Message寄發Gmail信件]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Mon,19 Oct 2009 22:58:29 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=295</guid>	
		<description><![CDATA[礙於JMail本身對SSL之限制，若有Gmail發送信件需求朋友，可以透過CDO.Message實現<br/><br/>&lt;%<br/>dim myMail<br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;)<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/sendusing" target="_blank">http://schemas.microsoft.com/cdo/configuration/sendusing</a>&#34;) = 2<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/smtpserver" target="_blank">http://schemas.microsoft.com/cdo/configuration/smtpserver</a>&#34;) = &#34;smtp.gmail.com&#34;<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/smtpserver" target="_blank">http://schemas.microsoft.com/cdo/configuration/smtpserver</a>port&#34;) = 465<br/>&#39;Authentication method, ssl o&#114; not, Username and password for the SMTP Server<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" target="_blank">http://schemas.microsoft.com/cdo/configuration/smtpauthenticate</a>&#34;) = 1<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/smtpusessl" target="_blank">http://schemas.microsoft.com/cdo/configuration/smtpusessl</a>&#34;) = true<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/sendusername" target="_blank">http://schemas.microsoft.com/cdo/configuration/sendusername</a>&#34;) = &#34;你的Gmail帳號&#34;<br/>myMail.Configuration.Fields.Item(&#34;<a href="http://schemas.microsoft.com/cdo/configuration/sendpassword" target="_blank">http://schemas.microsoft.com/cdo/configuration/sendpassword</a>&#34;) = &#34;你的Gmail密碼&#34;<br/>&#39;-------------------------------------<br/>myMail.Configuration.Fields.Up&#100;ate<br/>myMail.From = &#34;&lt;xxxxxxx@gmail.com&gt;&#34;<br/>myMail.To = &#34;&lt;xxxxxx@yahoo.com.tw&gt;&#34;<br/>myMail.Subject =&#34;&#34; <br/>myMail.TextBody = &#34;&#34;<br/>myMail.Send<br/>set myMail=nothing<br/>%&gt;<br/><br/>-------------------------------------------------------------------------------------------------------------------<br/>CDO 郵件元件使用方法 <br/>Microsoft從Windows Server 2000 及 Windows XP開始內建郵件元件已改為CDO <br/>在之前的系統內建郵件元件則是 CDONTS，各位要注意，以下是CDO的用法 <br/><br/>屬性 說明 <br/>Subject 郵件的主旨 <br/>From 寄件人的電子郵件信箱 <br/>To&nbsp;&nbsp; 收件人的電子郵件，可用分號；或逗號，斷開成多位收件人 <br/>CC&nbsp;&nbsp; 副本收件人的電子郵件，可用分號；或逗號，斷開成多位收件人 <br/>BCC 密送副本收件人的電子郵件，可用分號；或逗號，斷開成多位收件人 <br/>TextBody 郵件的本文-純文字模式 <br/>HTMLBody 郵件的本文-HTML模式 <br/><br/>方法 說明 <br/>Send 送出郵件 <br/>AddAttachment &#34;c:\mydocuments\test.txt&#34; 附件 <br/>Cr&#101;ateMHTMLBody &#34;<a href="http://www.w3schools.com/asp/" target="_blank">http://www.w3schools.com/asp/</a>&#34; 將一個網頁用HTML格式送出 <br/>Cr&#101;ateMHTMLBody &#34;file://c:/mydocuments/test.htm&#34; 將本機硬碟中的一個網頁用HTML格式送出 <br/><br/>範例： <br/>送出一封純文字信件: <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.TextBody=&#34;This is a message.&#34; <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/><br/>送出一封純文字信件並給副本收件人及密送副本收件人 <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.Bcc=&#34;someoneelse@somedomain.com&#34; <br/>myMail.Cc=&#34;someoneelse2@somedomain.com&#34; <br/>myMail.TextBody=&#34;This is a message.&#34; <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/><br/>送出一封HTML信件 <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.HTMLBody = &#34;&lt;h1&gt;This is a message.&lt;/h1&gt;&#34; <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/><br/>將一個網頁用HTML格式送出 <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.Cr&#101;ateMHTMLBody &#34;<a href="http://www.w3schools.com/asp/" target="_blank">http://www.w3schools.com/asp/</a>&#34; <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/><br/>將本機硬碟中的一個網頁用HTML格式送出 <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.Cr&#101;ateMHTMLBody &#34;file://c:/mydocuments/test.htm&#34; <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/><br/>送出一封純文字信件並含附件 <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.TextBody=&#34;This is a message.&#34; <br/>myMail.AddAttachment &#34;c:\mydocuments\test.txt&#34; <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/><br/>Sending a text e-mail using a remote server: <br/><br/>用遠端SMTP主機送出一封純文字信件 <br/>&lt;% <br/>Set myMail=Cr&#101;ateObject(&#34;CDO.Message&#34;) <br/>myMail.Subject=&#34;Sending email with CDO&#34; <br/>myMail.From=&#34;mymail@mydomain.com&#34; <br/>myMail.To=&#34;someone@somedomain.com&#34; <br/>myMail.TextBody=&#34;This is a message.&#34; <br/>myMail.Configuration.Fields.Item (&#34;<a href="http://schemas.microsoft.com/cdo/configuration/sendusing" target="_blank">http://schemas.microsoft.com/cdo/configuration/sendusing</a>&#34;) =2 <br/>&#39;遠端SMTP主機名稱或IP位址 <br/>myMail.Configuration.Fields.Item (&#34;<a href="http://schemas.microsoft.com/cdo/configuration/smtpserver" target="_blank">http://schemas.microsoft.com/cdo/configuration/smtpserver</a>&#34; )=&#34;smtp.server.com&#34; <br/>&#39;遠端SMTP主機埠號 Server port <br/>myMail.Configuration.Fields.Item (&#34;<a href="http://schemas.microsoft.com/cdo/configuration/smtpserver" target="_blank">http://schemas.microsoft.com/cdo/configuration/smtpserver</a>p o&#114;t&#34;) =25 <br/>myMail.Configuration.Fields.Up&#100;ate <br/>myMail.Send <br/>set myMail=nothing <br/>%&gt; <br/>]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=280</link>
			<title><![CDATA[如何將全形英文字、數值轉半形]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Fri,11 Jul 2008 23:08:46 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=280</guid>	
		<description><![CDATA[最近有網友詢問如何將全形英文字、數值轉成半形(作為使用者資料輸入之驗證)<br/>提供以下函數供需要的網友直接使用<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">Function ChgToHalfStr(strInput) <br/>strFullshape=&#34;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_~+, ?!@#$%^&amp;*().&#34; <br/>&nbsp;&nbsp;strHalfshape=&#34;ＡＢＣＤＥＦＧＨＩＪＫＬＭＮＯＰＱＲＳＴＵＶＷＸＹＺａｂｃｄｅｆｇｈｉｊｋｌｍｎｏｐｑｒｓｔｕｖｗｘｙｚ１２３４５６７８９０－＿～＋，　？！＠＃＄％︿＆＊（）‧&#34; <br/>&nbsp;&nbsp;For Subi=1 To len(strFullshape) <br/>&nbsp;&nbsp;&nbsp;&nbsp;strInput=Replace(strInput,Mid(strHalfshape,Subi,1),Mid(strFullshape,Subi,1)) <br/>&nbsp;&nbsp;Next <br/>&nbsp;&nbsp;ChgToHalfStr=strInput <br/>End Function</div></div><br/><br/>這是我的作法，如果格友有更具效率的寫法，歡迎分享喔~<br/>那如果是要將半形轉全形呢？聰明的您~應該不難反解了吧....]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=274</link>
			<title><![CDATA[ASP儲存遠端圖片至網站]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Sat,02 Feb 2008 19:41:59 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=274</guid>	
		<description><![CDATA[&lt;% <br/>&#39;先下載遠端圖片 <br/>url=&#34;<a href="http://www.im286.com/images/im286/logo.gif" target="_blank">http://www.im286.com/images/im286/logo.gif</a>&#34; &#39;遠端圖片位址 <br/>savepath=&#34;D:\photo\&#34; &#39;保存路徑 <br/>&#39;為檔重命名 <br/>randomize <br/>ranNum=int(999*rnd) <br/>filename=year(now)&amp;month(now)&amp;day(now)&amp;hour(now)&amp;minute(now)&amp;second(now)&amp;ranNum <br/>&#39;為檔重命名結束 <br/>set xmlhttp=server.cr&#101;ateobject(&#34;Microsoft.XMLHTTP&#34;) <br/>xmlhttp.open &#34;get&#34;,url,false <br/>xmlhttp.send <br/>img = xmlhttp.ResponseBody <br/>set xmlhttp=nothing <br/>set objAdostream=server.cr&#101;ateobject(&#34;ADODB.Stream&#34;) <br/>objAdostream.Open() <br/>objAdostream.type=1 <br/>objAdostream.Write(img) <br/>objAdostream.SaveToFile(savepath&amp;filename&amp;&#34;.jpg&#34;) <br/>objAdostream.SetEOS <br/>set objAdostream=nothing <br/>&#39;圖下載結束 <br/>Set Upload = Server.Cr&#101;ateObject(&#34;Persits.Upload&#34;) &#39;打開物件 <br/>Set File = Upload.OpenFile(savepath&amp;filename&amp;&#34;.jpg&#34;) &#39;打開已經保存的檔 <br/><br/>If File.ImageType &lt;&gt; &#34;JPG&#34; and File.ImageType &lt;&gt; &#34;GIF&#34; and File.ImageType &lt;&gt; &#34;BMP&#34; and File.ImageType &lt;&gt; &#34;PNG&#34; Then <br/>Upload.Del&#101;teFile savepath&amp;filename&amp;&#34;.jpg&#34; &#39;如果格式不正確就刪除這張已下載的圖片 <br/>response.write &#34;錯誤的圖片格式&#34; <br/>end if <br/>&#39;登出實例 <br/>Set Upload = nothing <br/>Set File = nothing <br/>%&gt;<br/>]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=255</link>
			<title><![CDATA[RSS Example for ASP]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Tue,27 Feb 2007 11:52:47 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=255</guid>	
		<description><![CDATA[<div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">&lt;%@Language=&#34;VBScript&#34; Codepage=&#34;65001&#34;%&gt;<br/>&lt;%<br/>Set XMLDOM=Server.Cr&#101;ateObject(&#34;Microsoft.FreeThreadedXMLDOM&#34;)<br/>XMLDOM.appendChild(XMLDOM.cr&#101;ateElement(&#34;rss&#34;))<br/>XMLDOM.documentElement.attributes.setNamedItem(XMLDOM.cr&#101;ateNode(2,&#34;version&#34;,&#34;&#34;)).text=&#34;2.0&#34;<br/>Set node=XMLDOM.documentElement.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;channel&#34;,&#34;&#34;))<br/><br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;title&#34;,&#34;&#34;)).text=&#34;標題&#34;<br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;link&#34;,&#34;&#34;)).text=&#34;網址&#34;<br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;language&#34;,&#34;&#34;)).text=&#34;zh-tw&#34;<br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;description&#34;,&#34;&#34;)).text=&#34;描述&#34;<br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;copyright&#34;,&#34;&#34;)).text=&#34;版權宣告&#34;<br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;generator&#34;,&#34;&#34;)).text=&#34;Tamako&#34;<br/>node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;webMaster&#34;,&#34;&#34;)).text=&#34;i@tamako.us&#34;<br/>%&gt;<br/>&lt;!--#include file=&#34;db.asp&#34;--&gt;&nbsp;&nbsp; &#39; 這裏請代入您的資料庫<br/>&lt;%<br/>Set rs=conn.Execute(&#34;Sel&#101;ct TOP 5 * FROM Indy o&#114;DER BY Release DESC&#34;)<br/>Do While Not rs.Eof<br/>Set Cnode=node.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;item&#34;,&#34;&#34;))<br/>Cnode.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;title&#34;,&#34;&#34;)).text= rs(&#34;title&#34;) &amp;&#34;&#34;<br/>Cnode.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;url&#34;,&#34;&#34;)).text= rs(&#34;title&#34;) &amp;&#34;&#34;<br/>Cnode.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;link&#34;,&#34;&#34;)).text= &#34;網址/show.asp? i=&#34;&amp;rs(&#34;Item&#34;)<br/>Cnode.appendChild(XMLDOM.cr&#101;ateNode(1,&#34;description&#34;,&#34;&#34;)).text= rs (&#34;Intro&#34;) &amp;&#34;&#34;<br/>rs.Movenext<br/>Loop<br/>set rs = nothing<br/>conn.close<br/>set conn = nothing<br/><br/>Response.Clear<br/>Response.CharSet=&#34;UTF-8&#34;<br/>Response.ContentType=&#34;text/xml&#34;<br/>Response.Write &#34;&#34;&amp;vbNewLine<br/>Response.Write XMLDOM.xml<br/>Set XMLDOM=Nothing<br/>%&gt; <br/></div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=253</link>
			<title><![CDATA[線上解壓縮(rar 檔)]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Wed,14 Feb 2007 11:33:32 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=253</guid>	
		<description><![CDATA[&lt;% <br/><br/>dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso <br/><br/>Mlpath=&#34;E:\page\mian\&#34;　　&#39;存放RAR.EXE和CMD.EXE的路徑 <br/><br/>ylj=Server.mappath(&#34;mian&#34;)&amp;&#34;\&#34;　&#39;解壓文件後所放的路徑 <br/><br/>ywj=Server.mappath(&#34;mian\apathy.rar&#34;)　&#39;要解壓的RAR文件 <br/><br/>Set Shell = Server.Cr&#101;ateObject(&#34;WScript.Shell&#34;) <br/><br/>rarcomm= &#34;E:\page\mian\cmd.exe /c &#34;&amp;Mlpath&amp;&#34;rar.exe x -t -o+ -p- &#34; <br/><br/>cmd=rarcomm&amp;ywj&amp;&#34; &#34;&amp;ylj <br/><br/>RetCode = Shell.Run(cmd,1, True) <br/><br/>%&gt;]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=252</link>
			<title><![CDATA[抓取 enctype=&#34;multipart/form-data&#34; 編碼過的數據]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Wed,14 Feb 2007 11:30:43 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=252</guid>	
		<description><![CDATA[test1.asp<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">Dim FormData, FormSize, Divider, bCrLf<br/>FormSize = Request.TotalBytes<br/>FormData = Request.BinaryRead(FormSize)<br/>bCrLf = ChrB(13) &amp; ChrB(10)<br/>Divider = LeftB(FormData, InStrB(FormData, bCrLf) - 1)<br/><br/>Function GetFormVal(FormName)<br/>GetFormVal = &#34;&#34;<br/>StartPos = LenB(Divider) + 2<br/>FormName = Chr(34) &amp; FormName &amp; Chr(34)<br/>Do While StartPos &gt; 0<br/>strlen = InStrB(StartPos, FormData, bCrLf) - StartPos<br/>SearchStr = MidB(FormData, StartPos, strlen)<br/>If InStr(bin2str(SearchStr), FormName) &gt; 0 Then<br/>ValStart = InStrB(StartPos, FormData, bCrLf &amp; bCrLf) + 4<br/>ValLen = InStrB(StartPos, FormData, Divider) - 2 - ValStart<br/>ValContent = MidB(FormData, ValStart, ValLen)<br/>If GetFormVal &lt;&gt; &#34;&#34; Then<br/>GetFormVal = GetFormVal &amp; &#34;,&#34; &amp; bin2str(ValContent)<br/>Else<br/>GetFormVal = bin2str(ValContent)<br/>End If<br/>End If<br/>If InStrB(StartPos, FormData, Divider) &lt; 1 Then<br/>Exit Do<br/>End If<br/>StartPos = InStrB(StartPos, FormData, Divider) + LenB(Divider) + 2<br/>Loop<br/>End Function<br/><br/>Function bin2str(binstr)<br/>Dim varlen, clow, ccc, skipflag<br/>skipflag = 0<br/>ccc = &#34;&#34;<br/>varlen = LenB(binstr)<br/>For i = 1 To varlen<br/>If skipflag = 0 Then<br/>clow = MidB(binstr, i, 1)<br/>If AscB(clow) &gt; 127 Then<br/>ccc = ccc &amp; Chr(AscW(MidB(binstr, i + 1, 1) &amp; clow))<br/>skipflag = 1<br/>Else<br/>ccc = ccc &amp; Chr(AscB(clow))<br/>End If<br/>Else<br/>skipflag = 0<br/>End If<br/>Next<br/>bin2str = ccc<br/>End Function<br/><br/>Function str2bin(str)<br/>For i = 1 To Len(str)<br/>str2bin = str2bin &amp; ChrB(Asc(Mid(str, i, 1)))<br/>Next<br/>End Function<br/><br/>Response.Write GetFormVal(&#34;T1&#34;)</div></div><br/><br/>test.asp<br/>&lt;form method=&#34;POST&#34; enctype=&#34;multipart/form-data&#34; action=&#34;test1.asp&#34;&gt;<br/>&lt;p&gt;&lt;input type=&#34;text&#34; name=&#34;T1&#34; size=&#34;20&#34;&gt;&lt;/p&gt;<br/>&lt;p&gt;&lt;input type=&#34;file&#34; name=&#34;F1&#34; size=&#34;20&#34;&gt;&lt;/p&gt;<br/>&lt;p&gt;&lt;input type=&#34;submit&#34; value=&#34;送出&#34; name=&#34;B1&#34;&gt;&lt;input type=&#34;reset&#34; value=&#34;重新設定&#34; name=&#34;B2&#34;&gt;&lt;/p&gt;<br/>&lt;/form&gt;]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=248</link>
			<title><![CDATA[ACCESS改為SQL需要注意哪幾個地方]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Mon,22 Jan 2007 00:37:51 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=248</guid>	
		<description><![CDATA[看到別人有時問這個方面的問題。<br/>於是在各網站總結前前輩高人的幾點想法，拿來共用：<br/>資料庫導入以後，自動增加欄位需要重寫，所有的數位類型需要增加長度，最好用decimal。<br/>所有的預設值都丟失了。主要是數位類型和日期類型。<br/><br/>所有now()，time()，date()要改成getdate()。<br/><br/>所有datediff(&#39;d&#39;, time1, time2)要改成datediff(day, time1, time2)<br/><br/>有可能一些true/false類型不能使用，要變為1/0。<br/><br/>備註類型要透過cast(column as varchar)來使用。<br/><br/>CursorType要改成1,也就是打開資料庫時要給出第一個數字參數為1，否則記錄可能顯示不完整。<br/><br/>isnull(rowname)要改成rowname = null<br/><br/>ACCESS的資料庫中的自動編號類型在轉化時，sql server並沒有將它設為自動編號型，我們需在SQL創建語句中加上identity，表示自動編號！<br/><br/>轉化時，跟日期有關的欄位，SQL SERVER默認為smalldatetime型，我們最好將它變為datetime型，因為datetime型的範圍比smalldatetime型大。有時用smalldatetime型時，轉化失敗，而用datetime型時，轉化成功。<br/><br/>對此兩種資料庫進行操作的sql語句不全相同，例如：在對ACCESS資料庫進行刪除紀錄時用：&#34;del&#101;te * from user wh&#101;re id=10&#34;,而對SQL SERVER資料庫進行刪除是用：&#34;del&#101;te user wh&#101;re id=10&#34;.<br/>日期函數不相同，在對ACCESS資料庫處理中，可用date()、time()等函數，但對SQL SERVER資料庫處理中，只能用datediff,dateadd等函數，而不能用date()、time()等函數。<br/><br/>在對ACCESS資料庫處理中,sql語句中直接可以用一些VB的函數，像cstr()函數，而對SQL SERVER資料庫處理中，卻不能用。]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=247</link>
			<title><![CDATA[利用ADODB.stream建立縮圖]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Mon,22 Jan 2007 00:35:33 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=247</guid>	
		<description><![CDATA[首先，我們知道在頁面中顯示圖片是如下代碼： <br/><br/>　　&lt;img src=&#34;pic.gif&#34; border=&#34;0&#34; width=&#34;300&#34; height=&#34;260&#34;&gt;<br/>　　src是圖片路徑，border控制圖片邊緣寬度，width是圖片的長度，height是圖片的高度。縮略圖的生成其實就是在原始尺寸上縮放。但一般為了儘量少失真，我們都會按比例縮放。於是，獲取圖片的長寬尺寸也就成了生成縮略圖的重點。<br/><br/>　　下面便是編寫無元件生成縮略圖的步驟：<br/><br/>　　1.無元件獲取圖片大小<br/><br/>　　以前剛學ASP不久時看到過一篇利用ASCII碼實現無元件獲取圖片尺寸的文章。後來試了試，發現在獲取jpg類圖片尺寸時總是不能正確顯示，在網上查了查，居然有不少網站轉載這個程式，但沒有一家指出此程式的缺陷，也就更談不上解決缺陷的辦法了。後來又google了一下，終於找到了一篇介紹利用ADODB.stream獲取圖片尺寸的文章，按其介紹的方法，修改裡面的代碼試了試，效果真的還不錯，現在將其拿出來與大家分享：<br/><br/>　　利用ADODB.stream獲取圖片尺寸的通用類 <br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">&lt;%<br/>&#39;//////////// GPS：Get Picture Size //////////////<br/>&#39;//////////////利用ADODB.stream獲取圖片尺寸//////////////<br/>&#39;/////////Cited By Leon（心晴） 2005年8月11日//////////<br/><br/>Class GPS<br/>Dim aso<br/><br/>Private Sub Class_Initialize<br/>Set aso=Cr&#101;ateObject(&#34;Adodb.Stream&#34;)<br/>aso.Mode=3 <br/>aso.Type=1 <br/>aso.Open <br/>End Sub<br/><br/>Private Sub Class_Terminate<br/>set aso=nothing<br/>End Sub<br/><br/>Private Function Bin2Str(Bin)<br/>Dim I, Str<br/>For I=1 to LenB(Bin)<br/>clow=MidB(Bin,I,1)<br/>if AscB(clow)&lt;128 then<br/>Str = Str &amp; Chr(ASCB(clow))<br/>Else<br/>I=I+1<br/>if I &lt;= LenB(Bin) then Str = Str &amp; Chr(ASCW(MidB(Bin,I,1)&amp;clow))<br/>end If<br/>Next <br/>Bin2Str = Str<br/>End Function<br/><br/>Private Function Num2Str(num,base,lens)<br/>&#39;GPS (2005-8-11)<br/>dim ret<br/>ret = &#34;&#34;<br/>while(num&gt;=base)<br/>ret = (num mod base) &amp; ret<br/>num = (num - num mod base)/base<br/>wend<br/>Num2Str = right(string(lens,&#34;0&#34;) &amp; num &amp; ret,lens)<br/>End Function<br/><br/>Private Function Str2Num(str,base)<br/>&#39;GPS (2005-8-11)<br/>dim ret<br/>ret = 0<br/>for i=1 to len(str)<br/>ret = ret *base + cint(mid(str,i,1))<br/>next<br/>Str2Num=ret<br/>End Function<br/><br/>Private Function BinVal(bin)<br/>&#39;GPS (2002-8-11)<br/>dim ret<br/>ret = 0<br/>for i = lenb(bin) to 1 step -1<br/>ret = ret *256 + ascb(midb(bin,i,1))<br/>next<br/>BinVal=ret<br/>End Function<br/><br/>Private Function BinVal2(bin)<br/>&#39;GPS (2002-8-11)<br/>dim ret<br/>ret = 0<br/>for i = 1 to lenb(bin)<br/>ret = ret *256 + ascb(midb(bin,i,1))<br/>next<br/>BinVal2=ret<br/>End Function<br/><br/>&#39;///以下是調用代碼///<br/>Function getImageSize(filespec) <br/>&#39;GPS (2002-8-11)<br/>dim ret(3)<br/>aso.LoadFromFile(filespec)<br/>bFlag=aso.read(3)<br/>sel&#101;ct case hex(binVal(bFlag))<br/>case &#34;4E5089&#34;:<br/>aso.read(15)<br/>ret(0)=&#34;PNG&#34;<br/>ret(1)=BinVal2(aso.read(2))<br/>aso.read(2)<br/>ret(2)=BinVal2(aso.read(2))<br/>case &#34;464947&#34;:<br/>aso.read(3)<br/>ret(0)=&#34;GIF&#34;<br/>ret(1)=BinVal(aso.read(2))<br/>ret(2)=BinVal(aso.read(2))<br/>case &#34;535746&#34;:<br/>aso.read(5)<br/>binData=aso.Read(1)<br/>sConv=Num2Str(ascb(binData),2 ,8)<br/>nBits=Str2Num(left(sConv,5),2)<br/>sConv=mid(sConv,6)<br/>while(len(sConv)&lt;NBITS*4)<br/>binData=aso.Read(1)<br/>sConv=sConv&amp;Num2Str(ascb(binData),2 ,8)<br/>wend<br/>ret(0)=&#34;SWF&#34;<br/>ret(1)=int(abs(Str2Num(mid(sConv,1*nBits+1,nBits),2)-Str2Num(mid(sConv,0*nBits+1,nBits),2))/20)<br/>ret(2)=int(abs(Str2Num(mid(sConv,3*nBits+1,nBits),2)-Str2Num(mid(sConv,2*nBits+1,nBits),2))/20)<br/>case &#34;FFD8FF&#34;:<br/>do <br/>do: p1=binVal(aso.Read(1)): loop while p1=255 and not aso.EOS<br/>if p1&gt;191 and p1&lt;196 then exit do else aso.read(binval2(aso.Read(2))-2)<br/>do:p1=binVal(aso.Read(1)):loop while p1&lt;255 and not aso.EOS<br/>loop while true<br/>aso.Read(3)<br/>ret(0)=&#34;JPG&#34;<br/>ret(2)=binval2(aso.Read(2))<br/>ret(1)=binval2(aso.Read(2))<br/>case else:<br/>if left(Bin2Str(bFlag),2)=&#34;BM&#34; then<br/>aso.Read(15)<br/>ret(0)=&#34;BMP&#34;<br/>ret(1)=binval(aso.Read(4))<br/>ret(2)=binval(aso.Read(4))<br/>else<br/>ret(0)=&#34;&#34;<br/>end if<br/>end sel&#101;ct<br/>ret(3)=&#34;width=&#34;&#34;&#34; &amp; ret(1) &amp;&#34;&#34;&#34; height=&#34;&#34;&#34; <br/>&amp; ret(2) &amp;&#34;&#34;&#34;&#34;<br/>getimagesize=ret<br/>End Function<br/>End Class<br/>%&gt;</div></div><br/>將以上代碼複製生成GPS.asp檔，這樣無元件獲取圖片尺寸的通用類就OK了。<br/><br/>2.現在我們先設計一個ShowImg.asp頁面用來顯示縮略圖及相關資訊。具體設計如下：<br/>　　圖片：<br/>　　圖片格式：<br/>　　圖片尺寸：<br/>　　圖片大小：<br/>　　點擊次數：<br/><br/>　　下面，我們獲取圖片的絕對路徑。代碼如下：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">&lt;% <br/>&#39;/////獲取ShowImg.asp的絕對路徑/////<br/>Dim curFile<br/>curFile=Server.mappath(Request.servervariables(&#34;PATH_INFO&#34;))<br/>Dim curfilename,filename<br/><br/>&#39;/////圖片相對路徑（存於資料庫中）<br/>cufilename=rs(&#34;ImgURL&#34;)<br/><br/>&#39;/////因為ShowImg.asp與images在同一目錄，所以我們用instrrev獲取images的路徑/////<br/>filename=left(curFile,instrrev(curFile,&#34;\&#34;))&amp;cufilename<br/><br/>&#39;/////建立GPS類實體/////<br/>Dim GetPicSize<br/>Set GetPicSize=new GPS<br/>Set fs=Server.Cr&#101;ateObject(&#34;Scripting.FileSystemObject&#34;)<br/><br/>&#39;/////獲取圖片類型/////<br/>Dim PicSuffixName<br/>PicSuffixName=fs.GetExtensionName(filename)<br/>Dim PD &#39;//Picture Dimension<br/>Dim PWidth,PHeight<br/>Sel&#101;ct Case PicSuffixName<br/>Case &#34;gif&#34;,&#34;bmp&#34;,&#34;jpg&#34;,&#34;png&#34;:<br/><br/>&#39;/////調用GPS通用類中的GetImageSize函數獲取圖片尺寸/////<br/>PD=GetPicSize.GetImageSize(filename)<br/>PWidth=PD(1) &#39;//獲取圖片寬度<br/>PHeight=PD(2) &#39;//獲取圖片高度<br/>Case &#34;swf&#34;<br/>PD=GetPicSize.GetImageSize(filename)<br/>PWidth=PD(1) &#39;//獲取Flash寬度<br/>PHeight=PD(2) &#39;//獲取Flash高度<br/>Case Else<br/>End Sel&#101;ct<br/>Set fs=Nothing<br/>Set GetPicSize=Nothing<br/>%&gt;</div></div><br/>將上面的代碼複製到的上面就OK了！<br/><br/>　　當然，有人會說，獲取路徑不一定要用PATH_INFO，直接用server.mappath()不就可以了嘛，呵呵，蘿蔔青菜各有所愛，主要是我用PATH_INFO可以實現FSO的一些功能而用server.mappath()沒有搞定，所以一直使用這個。<br/>3.定義縮略圖尺寸 <br/><br/>　　這部分代碼就是仁者見仁，智者見智了。首先，我們需要規定縮略圖顯示尺寸範圍，譬如：300X260，代碼可以這樣寫：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent"><br/>&lt;%<br/>Dim PXWidth,PXHeight<br/>Dim Pp &#39;//Proportion<br/>If PWidth=0 o&#114; PWidth=&#34;&#34; Then<br/>PXWidth=0<br/>PXHeight=0<br/>Else<br/>Pp=FormatNumber(PWidth/PHeight,2) &#39;//長寬比<br/>End If<br/>If PWidth&gt;=PHeight Then<br/>If PWidth&gt;=300 Then<br/>PXWidth=300<br/>PXHeight=FormatNumber(300/Pp,0)<br/>Else<br/>PXWidth=PWidth<br/>PXHeight=PHeight<br/>End If<br/>Else<br/>If PHeight&gt;=260 Then<br/>PXHeight=260<br/>PXWidth=FormatNumber(260*Pp,0)<br/>Else<br/>PXWidth=PWidth<br/>PXHeight=PHeight<br/>End If<br/>End If<br/>%&gt;</div></div><br/><br/>　　將上面的代碼緊接第二步寫下即可。調用時代碼如下：<br/>&lt;img src=&lt;%=curfilename%&gt; border=&#34;0&#34; width=&lt;%=PXWidth%&gt; <br/>height=&lt;%=PXHeight%&gt;&gt;<br/><br/>　　至於圖片格式可以用得到，圖片尺寸可以寫成<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">&lt;%<br/>response.write PXWidth&amp;&#34;X&#34;&amp;PXHeight<br/>%&gt;</div></div><br/><br/>　　圖片大小可以用FSO.GetFileSize(filename)來實現，而點擊次數可以簡單地用SQL語句實現，具體編碼就不再累述了。<br/><br/>　　這樣，一個無元件生成縮略圖程式就寫好了，不過只要大家能將方法掌握相信還是有很大提高的。<br/><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=246</link>
			<title><![CDATA[通過ASP遠端註冊自己的元件]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Sun,21 Jan 2007 23:30:44 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=246</guid>	
		<description><![CDATA[把asp程式作成dll很多好處，但是有一點，該dll必須註冊才能在asp中調用。如果是自己的伺服器那還好，但如果是租用的虛擬伺服器，就沒辦法使用了。<br/><br/>怎樣在遠端主機上註冊我們的dll呢？答案就是在伺服器端使用<strong><span style="color:Red">Shell</span></strong>！！！<br/><br/>讓我們先將自己的dll檔通過ftp或http上傳到伺服器上，然後作一個asp程式，調用WScript.Shell來執行regsvr32命令：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent"><span style="color:Blue">Set oShell = Cr&#101;ateObject (&#34;WScript.Shell&#34;)<br/>oShell.Run &#34;c:\WINNT\system32\regsvr32.exe /s d:\xxx.dll&#34;, 0, False</span></div></div><br/><br/>當然如果對方的伺服器安全搞的很好的話，這個代碼也許就不能用了，但不管怎麼樣，學習一下也是好的，：）<br/><br/>在這裡也要提醒那些出租空間的朋友，你的伺服器是否限制了使用WScript.Shell的許可權？還是小心為妙<br/>完整代碼如下，保存為.asp即可使用：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.pro-soho.com/Blog/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代碼"/> 程序代碼</div><div class="UBBContent">&lt;% Response.Buffer = True %&gt;<br/>&lt;% Server.ScriptTimeout = 500 <br/>Dim frmFolderPath, frmFilePath<br/>frmFolderPath = Request.Form(&#34;frmFolderPath&#34;)<br/>frmFilePath = Request.Form(&#34;frmDllPath&#34;)<br/>frmMethod = Request.Form(&#34;frmMethod&#34;)<br/>btnREG = Request.Form(&#34;btnREG&#34;)<br/>%&gt;<br/>&lt;HTML&gt;<br/>&lt;HEAD&gt;<br/>&lt;TITLE&gt;Regsvr32.asp&lt;/TITLE&gt;<br/>&lt;STYLE TYPE=&#34;TEXT/CSS&#34;&gt;<br/>.Legend {FONT-FAMILY: veranda; FONT-SIZE: 14px; FONT-WEIGHT: bold; COLOR: blue}<br/>.FS {FONT-FAMILY: veranda; FONT-SIZE: 12px; BORDER-WIDTH: 4px; BORDER-COLOR: green;<br/>MARGIN-LEFT:2px; MARGIN-RIGHT:2px}<br/>TD {MARGIN-LEFT:6px; MARGIN-RIGHT:6px; PADDING-LEFT:12px; PADDING-RIGHT:12px}<br/>&lt;/STYLE&gt;<br/>&lt;/HEAD&gt;<br/>&lt;BODY&gt;<br/>&lt;FORM NAME=&#34;regForm&#34; METHOD=&#34;POST&#34;&gt;<br/>&lt;TABLE BORDER=0 CELLSPACING=6 CELLPADDING=6 MARGINWIDTH=6&gt;<br/>&lt;TR&gt;<br/>&lt;TD VALIGN=TOP&gt;<br/>&lt;FIELDSET ID=FS1 NAME=FS1 CLASS=FS&gt;<br/>&lt;LEGEND CLASS=Legend&gt;Regsvr Functions&lt;/LEGEND&gt;<br/>Ins&#101;rt Path to DLL Directory&lt;BR&gt;<br/>&lt;INPUT TYPE=TEXT NAME=&#34;frmFolderPath&#34; VALUE=&#34;&lt;%=frmFolderPath%&gt;&#34;&gt;&lt;BR&gt;<br/>&lt;INPUT TYPE=SUBMIT NAME=btnFileList VALUE=&#34;Build File List&#34;&gt;&lt;BR&gt;<br/>&lt;% <br/>IF Request.Form(&#34;btnFileList&#34;) &lt;&gt; &#34;&#34; o&#114; btnREG &lt;&gt; &#34;&#34; Then<br/>Set RegisterFiles = New clsRegister<br/>RegisterFiles.EchoB(&#34;&lt;B&gt;Sel&#101;ct File&lt;/B&gt;&#34;)<br/>Call RegisterFiles.init(frmFolderPath)<br/>RegisterFiles.EchoB(&#34;&lt;BR&gt;&lt;INPUT TYPE=SUBMIT NAME=btnREG VALUE=&#34; &amp; Chr(34) _<br/>&amp; &#34;REG/UNREG&#34; &amp; Chr(34) &amp; &#34;&gt;&#34;)<br/>IF Request.Form(&#34;btnREG&#34;) &lt;&gt; &#34;&#34; Then<br/>Call RegisterFiles.Register(frmFilePath, frmMethod)<br/>End IF<br/>Set RegisterFiles = Nothing<br/>End IF<br/>%&gt;<br/>&lt;/FIELDSET&gt;<br/>&lt;/TD&gt;<br/>&lt;/TR&gt;<br/>&lt;/TABLE&gt;<br/>&lt;/FORM&gt;<br/>&lt;/BODY&gt;<br/>&lt;/HTML&gt;<br/>&lt;%<br/>Class clsRegister<br/>Private m_oFS <br/>Public Property Let oFS(objOFS)<br/>m_oFS = objOFS<br/>End Property<br/>Public Property Get oFS()<br/>Set oFS = Server.Cr&#101;ateObject(&#34;Scripting.FileSystemObject&#34;)<br/>End Property<br/><br/>Sub init(strRoot) &#39;&#39;Root to Search (c:, d:, e:)<br/>Dim oDrive, o&#114;ootDir<br/>IF oFS.FolderExists(strRoot) Then<br/>IF Len(strRoot) &lt; 3 Then &#39;&#39;Must Be a Drive<br/>Set oDrive = oFS.GetDrive(strRoot)<br/>Set o&#114;ootDir = oDrive.RootFolder<br/>Else<br/>Set o&#114;ootDir = oFS.GetFolder(strRoot)<br/>End IF<br/>Else<br/>EchoB(&#34;&lt;B&gt;Folder ( &#34; &amp; strRoot &amp; &#34; ) Not Found.&#34;)<br/>Exit Sub<br/>End IF<br/>setRoot = o&#114;ootDir<br/>Echo(&#34;&lt;Sel&#101;ct NAME=&#34; &amp; Chr(34) &amp; &#34;frmDllPath&#34; &amp; Chr(34) &amp; &#34;&gt;&#34;)<br/>Call getAllDlls(oRootDir)<br/>EchoB(&#34;&lt;/Sel&#101;ct&gt;&#34;)<br/>BuildOptions<br/>End Sub<br/>Sub getAllDlls(oParentFolder)&nbsp;&nbsp;&nbsp;&nbsp;&#39;&#39;通過fso列舉所有的dll和ocx檔<br/>Dim oSubFolders, oFile, oFiles<br/>Set oSubFolders = oParentFolder.SubFolders<br/>Set opFiles = oParentFolder.Files<br/>For Each oFile in opFiles<br/>IF Right(lCase(oFile.Name), 4) = &#34;.dll&#34; o&#114; Right(lCase(oFile.Name), 4) = &#34;.ocx&#34; Then<br/>Echo(&#34;&lt;OPTION VALUE=&#34; &amp; Chr(34) &amp; oFile.Path &amp; Chr(34) &amp; &#34;&gt;&#34; _<br/>&amp; oFile.Name &amp; &#34;&lt;/Option&gt;&#34;)<br/>End IF<br/>Next<br/>On Error Resume Next<br/>For Each oFolder In oSubFolders &#39;&#39;Iterate All Folders in Drive<br/>Set oFiles = oFolder.Files<br/>For Each oFile in oFiles<br/>IF Right(lCase(oFile.Name), 4) = &#34;.dll&#34; o&#114; Right(lCase(oFile.Name), 4) = &#34;.ocx&#34; Then<br/>Echo(&#34;&lt;OPTION VALUE=&#34; &amp; Chr(34) &amp; oFile.Path &amp; Chr(34) &amp; &#34;&gt;&#34; _<br/>&amp; oFile.Name &amp; &#34;&lt;/Option&gt;&#34;)<br/>End IF<br/>Next<br/>Call getAllDlls(oFolder)<br/>Next<br/>On Error GoTo 0<br/>End Sub<br/>Sub Register(strFilePath, regMethod)<br/>Dim theFile, strFile, oShell, exitcode<br/>Set theFile = oFS.GetFile(strFilePath)<br/>strFile = theFile.Path<br/>Set oShell = Cr&#101;ateObject (&#34;WScript.Shell&#34;)<br/>IF regMethod = &#34;REG&#34; Then &#39;&#39;Register<br/>oShell.Run &#34;c:\WINNT\system32\regsvr32.exe /s &#34; &amp; strFile, 0, False<br/>exitcode = oShell.Run(&#34;c:\WINNT\system32\regsvr32.exe /s &#34; &amp; strFile, 0, False)<br/>EchoB(&#34;regsvr32.exe exitcode = &#34; &amp; exitcode)<br/>Else &#39;&#39;unRegister<br/>oShell.Run &#34;c:\WINNT\system32\regsvr32.exe /u/s &#34; &amp; strFile, 0, False<br/>exitcode = oShell.Run(&#34;c:\WINNT\system32\regsvr32.exe /u/s &#34; &amp; strFile, 0, False)<br/>EchoB(&#34;regsvr32.exe exitcode = &#34; &amp; exitcode)<br/>End IF<br/>Cleanup oShell<br/>End Sub<br/>Sub BuildOptions<br/>EchoB(&#34;Register: &lt;INPUT TYPE=RADIO NAME=frmMethod VALUE=REG CHECKED&gt;&#34;)<br/>EchoB(&#34;unRegister: &lt;INPUT TYPE=RADIO NAME=frmMethod VALUE=UNREG&gt;&#34;)<br/>End Sub<br/>Function Echo(str)<br/>Echo = Response.Write(str &amp; vbCrLf)<br/>End Function<br/>Function EchoB(str)<br/>EchoB = Response.Write(str &amp; &#34;&lt;BR&gt;&#34; &amp; vbCrLf)<br/>End Function<br/>Sub Cleanup(obj)<br/>If isObject(obj) Then<br/>Set obj = Nothing<br/>End IF<br/>End Sub<br/>Sub Class_Terminate()<br/>Cleanup oFS<br/>End Sub<br/>End Class<br/>%&gt;</div></div><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.pro-soho.com/Blog/default.asp?id=238</link>
			<title><![CDATA[ASP生成靜態網頁的方法]]></title>
			<author>scooter.tw@gmail.com(admin)</author>
			<category><![CDATA[ASP]]></category>
			<pubDate>Fri,01 Dec 2006 11:22:26 +0800</pubDate>
			<guid>http://www.pro-soho.com/Blog/default.asp?id=238</guid>	
		<description><![CDATA[隨著網站訪問量的加大，每次從資料庫讀取都是以效率作為代價的，很多用ACCESS作資料庫的更會深有體會，靜態頁加在搜索時，也會被優先考慮。網路上流行的做法是將資料源代碼寫入資料庫再從資料庫讀取生成靜態面，這樣無形間就加大了資料庫。將現有的ASP頁直接生成靜態頁，將會節省很多。<br/><br/>下面的例子是將、index.asp?id=1/index.asp?id=2/index.asp?id=3/這三個動態頁面，分別生成ndex1.htm,index2.htm,index3.htm存在根目錄下面：<br/><br/>&lt;%<br/>dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url,Html_Temp<br/>Html_Temp=&#34;&lt;UL&gt;&#34;<br/>For i=1 To 3<br/>Html_Temp = Html_Temp&amp;&#34;&lt;LI&gt;&#34;<br/>Item_Classid = i<br/>FileName = &#34;Index&#34;&amp;Item_Classid&amp;&#34;.htm&#34;<br/>FilePath = Server.MapPath(&#34;/&#34;)&amp;&#34;\&#34;&amp;FileName<br/>Html_Temp = Html_Temp&amp;FilePath&amp;&#34;&lt;/LI&gt;&#34;<br/>Do_Url = &#34;<a href="http://" target="_blank">http://</a>&#34;<br/>Do_Url = Do_Url&amp;Request.ServerVariables(&#34;SERVER_NAME&#34;)&amp;&#34;/main/index.asp&#34;<br/>Do_Url = Do_Url&amp;&#34;?Item_Classid=&#34;&amp;Item_Classid<br/>strUrl = Do_Url<br/>dim objXmlHttp<br/>set objXmlHttp = Server.Cr&#101;ateObject(&#34;Microsoft.XMLHTTP&#34;)<br/>objXmlHttp.open &#34;GET&#34;,strUrl,false<br/>objXmlHttp.send()<br/>Dim binFileData<br/>binFileData = objXmlHttp.responseBody<br/>Dim objAdoStream<br/>set objAdoStream = Server.Cr&#101;ateObject(&#34;ADODB.Stream&#34;)<br/>objAdoStream.Type = 1<br/>objAdoStream.Open()<br/>objAdoStream.Write(binFileData)<br/>objAdoStream.SaveToFile FilePath,2 <br/>objAdoStream.Close()<br/>Next<br/>Html_Temp = Html_Temp&amp;&#34;&lt;UL&gt;&#34;<br/>%&gt;<br/>&lt;%<br/>Response.Write ( &#34;成功生成檔：&#34; )<br/>Response.Write ( &#34;&lt;BR&gt;&#34; )<br/>Response.Write Html_Temp<br/>%&gt;]]></description>
		</item>
		
</channel>
</rss>