<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-23037558</id><updated>2024-11-08T23:38:30.051+08:00</updated><category term="XPath"/><category term="ASP .NET"/><category term="C#"/><category term="WCF"/><category term="X.509"/><category term="Entity Framework"/><category term="MsSql"/><category term="VS Template"/><category term="VisualStudio"/><category term="Windows"/><category term="Active Directory"/><category term="Html"/><category term="LDAP"/><category term="SQL"/><category term="VSIX"/><title type='text'>小實拓也的知識天堂</title><subtitle type='html'>這是我個人知識管理的園地~如果你對我的文章有任何想法，希望可以留下您寶貴的意見。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-23037558.post-8298428598975391255</id><published>2013-09-05T16:51:00.000+08:00</published><updated>2013-09-05T16:53:15.158+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C#：如何將文字檔編碼成 ANSI</title><content type='html'>一般我們程式開發把字串存成文字檔 (.txt)都會以 Unicode 來作編碼，但當我們想用 ANSI 來作編碼時，可能大家不知道要用哪種編碼來生成... 原來他的編碼是以 Windows 作業系統預設的語系為主，像是我的 Windows 作業系統是繁體中文語系的，則編碼要使用&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;System.Text.Encoding.GetEncoding(&quot;big5&quot;)&lt;/b&gt;&lt;/span&gt; 或是 &lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;System.Text.Encoding.GetEncoding(950)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
這樣讀取才不會有亂碼產生，而生成的文字檔就會是以 ANSI 來作編碼。&lt;br /&gt;
另外各語系所使用的 code page，可參考此網址：&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Code_page&quot;&gt;http://en.wikipedia.org/wiki/Code_page&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
請不要誤以為 ANSI 是以&amp;nbsp; ASCII 來編碼的喔...&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/8298428598975391255/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/09/c-ansi.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8298428598975391255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8298428598975391255'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/09/c-ansi.html' title='C#：如何將文字檔編碼成 ANSI'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-1061009245044108639</id><published>2013-09-04T19:13:00.003+08:00</published><updated>2013-09-04T19:15:42.470+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VS Template"/><title type='text'>如何透過Visual Studio Item Template Project 來設定範本項目的分類</title><content type='html'>Visual Studio 的範本，可透過專案的方式來開發，如果你是開發 Item Template 並且 指定給 C# 專案使用的話，建置後範本檔(.zip) 預設會放置在 &lt;b&gt;ItemTemplates\CSharp\1033\&lt;/b&gt; 資料夾下。&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;由於 VS 的範本是透由資料夾來區分 &quot;範本類型&quot;、&quot;使用的專案類型&quot;、&quot;分類&quot;、語系。&lt;br /&gt;
&lt;br /&gt;
因此上述的預設路徑分別代表的是，此範本為&lt;b&gt;項目範本&lt;/b&gt;並使用在 &lt;b&gt;C# 專案&lt;/b&gt;內，然後是給&lt;b&gt;繁體中文&lt;/b&gt;語系使用。&lt;br /&gt;
&lt;br /&gt;
當我們想要再加入此範本的分類或是更改語系時，.vstemplate 設定檔似乎是沒有 tag 可供設定…後來我發現其實必須在顯示出 .vstemplate 檔案的屬性視窗時，就有項目可供我們設定，其顯示的畫面如下：&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;353&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhetSp9pBTyNkA5QTh0PwCF8rjgsADR_PRy6JyGQ7qZ1AkY4Jg0e_PpUPOsoqWT3vUBbQo_8n1K72WC33rL0cGAJTV-Dy6DsNqYTfszaza1x4V2ACi4HMfFXusMCfL6xqNFUcd/s400/vstemplate+%25E5%25B1%25AC%25E6%2580%25A7%25E8%25A6%2596%25E7%25AA%2597.jpg&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
在 VSTemplate 的分類下 Category 可設定範本的分類，而 Culture 則可設定此範本的語系。&lt;br /&gt;
&lt;br /&gt;
如果我們設定如上圖所顯示的，分類為 Data ；語系為 zh-TW，則範本檔則會重新放置在 &amp;nbsp;&lt;b&gt;ItemTemplates\CSharp\Data\1028\&lt;/b&gt; 裡。&lt;br /&gt;
&lt;br /&gt;
這樣範本就可以放置在我們要分類，才不會在選擇範本時都只出現在範本項目視窗一開頭的內容而已。</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/1061009245044108639/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/09/visual-studio-item-template-project.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1061009245044108639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1061009245044108639'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/09/visual-studio-item-template-project.html' title='如何透過Visual Studio Item Template Project 來設定範本項目的分類'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhetSp9pBTyNkA5QTh0PwCF8rjgsADR_PRy6JyGQ7qZ1AkY4Jg0e_PpUPOsoqWT3vUBbQo_8n1K72WC33rL0cGAJTV-Dy6DsNqYTfszaza1x4V2ACi4HMfFXusMCfL6xqNFUcd/s72-c/vstemplate+%25E5%25B1%25AC%25E6%2580%25A7%25E8%25A6%2596%25E7%25AA%2597.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-1701527717363865027</id><published>2013-09-04T18:31:00.000+08:00</published><updated>2013-09-04T19:16:51.943+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="VS Template"/><title type='text'>如何加入新的程式碼產生項目給 ADO.NET 實體資料模型設計工具使用</title><content type='html'>一般我們在使用 Entity Framework 時，Entity 的部份都會透過 ADO.NET 實體資料模型 (edmx) 來作設計, 一般也稱為 Entity Framework Designer (EF Designer)，透過它會自動產生所需要的 Entity 類別。&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;當我們想選擇不同的程式碼產生範本時，可以透過此設計工具按右鍵有個功能：「加入程式碼產生項目…」(Code Generation Item) 來選擇你適合的範本產生 Entity 類別。&lt;br /&gt;
&lt;br /&gt;
但有時這些範本可能對於我們並不合用或是想增加內容時，我們就會修改範本，然後透過 Visual Studio 「匯出範本...」的功能，或是新增 Item Project&amp;nbsp; (可能需要裝 Visual Studio SDK) 來產生範本檔，並放在正確的資料夾上，即會在新增項目的介面上，呈現出你所自訂的範本項目並可作選擇。&lt;br /&gt;
&lt;br /&gt;
當你將範本放到正確的位置後，你可能會發現在 edmx 設計工具內，要選擇你自訶程式碼產生項目的範本，卻有可能仍然找不到... 我也是遇到相同的問題，找了好久，終於發現問題所在…&lt;br /&gt;
&lt;br /&gt;
原來重點是在於 .vstemplate 檔的命名，我發現檔名開頭一定要是&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;ADONETArtifactGenerator_&lt;/span&gt; &lt;/b&gt;或是&lt;b&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;DbContext_&lt;/span&gt; &lt;/b&gt;就一定會過，只要檔名開頭不是上述所指的字句，你 template 設定檔再怎麼設定，也不會再 EF Designer 內 Code Generation Item 的選擇畫面裡看到你自訂的範本。&lt;br /&gt;
&lt;br /&gt;
例如：&lt;br /&gt;
&lt;br /&gt;
DbContext_MyTemplate.vstemplate&amp;nbsp; → &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;pass&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
MyTemplate.vstemplate → &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;no pass&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
以上是在 EF Designer 內要加入新的程式碼產生項目時，才會遇到的問題，其它範本在「加入新的項目」裡應該是不會有這問題產生。</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/1701527717363865027/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/09/adonet.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1701527717363865027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1701527717363865027'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/09/adonet.html' title='如何加入新的程式碼產生項目給 ADO.NET 實體資料模型設計工具使用'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-6411926957145734169</id><published>2013-09-03T16:52:00.002+08:00</published><updated>2013-09-04T19:50:09.396+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VisualStudio"/><category scheme="http://www.blogger.com/atom/ns#" term="VSIX"/><title type='text'>Visual Studio 各類型範本的使用說明</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Visual Studio 的範本分為&lt;b&gt;專案範本(Project Template)&lt;/b&gt; 與 &lt;b&gt;項目範本 (Item &lt;/b&gt;&lt;b&gt;&lt;b&gt;Template&lt;/b&gt;)&lt;/b&gt; 二種，而範本放置的路徑會依下列情況也有所不同：&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: #660000;&quot;&gt;Visual Studio 預設的範本&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: #660000;&quot;&gt;使用者客製的範本&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: #660000;&quot;&gt;VISX 擴充套件安裝的範本&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;以上這些範本，都有可能會有子資料夾來作分類，如下圖所示：&lt;br /&gt;
像是 &quot;CSharp&quot; 資料夾，即以 C# 作為分類來區隔範本，最多可到次分類。&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;192&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrRnaG7IPB1ctGHFCwDnycd8JKpvgTU-3f9wgrESAsmQKVCIBRe-Ufv8I9vhU3B0jXbj99yUJ1-S1_Bk2jrutHSJSdWIxo602ZbKH4BwphEncNMAD_iai4fARxkmOEtjPK9YK1/s400/%E7%AF%84%E6%9C%AC%E5%88%86%E9%A1%9E%E8%B3%87%E6%96%99%E5%A4%BE.jpg&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
而下列畫面中一堆數字的資料夾，則以當地語言作為區隔。&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOg9nBnmj6onsLDUq5ThaE61P1TsuyXnN_hqf-iWDeLNtA1cMhmBgh7ub9f2024TNLrJeec3YQgWd9FJiKLM-5yc_EdBZA14ULCcAv2ZqYP1eyNQ8XE4bVCggoB6P09x3ZRzhW/s400/%E7%AF%84%E6%9C%AC%E7%95%B6%E5%9C%B0%E5%8C%96%E8%AA%9E%E8%A8%80%E8%B3%87%E6%96%99%E5%A4%BE.jpg&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
例如 1033 為英文的版本、1028 為繁體中文的版本、2025 為簡體中文版本。&lt;br /&gt;
&lt;br /&gt;
在每個範本檔案中都會放置一個名叫&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;範本名稱&lt;/span&gt;.vstemplate&lt;/b&gt;&amp;nbsp;的檔案，其內容為 xml 的格式，可設定對應的專案類型 (ProjectType)、專案的子類型 (ProjectSubType)、顯示的範本名稱 (Name)、描述 (Description)、顯示的圖示檔 (Icon) 等... 設定完成後，在專案內，開啟新增項目畫面時，即會由上述的設定呈現出下列的畫面：&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Ef9RhagVhr8FD7PCeOHEcmTBTiQXQNcG5sWcZ_NApjHtpGi7vlSWgef81DCGBI6S4bP70SaomHLfekzw8vt_VuLOP0hv9WCpU3Bp77myxKhTW5jMVku9-KsG2gCQA8_NA9_Z/s400/%25E5%258A%25A0%25E5%2585%25A5%25E7%25AF%2584%25E6%259C%25AC%25E7%259A%2584%25E7%2595%25AB%25E9%259D%25A2.jpg&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
以下說明各類型範本所放置的位置及運用：&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;1. Visual Studio 預設的範本&lt;/span&gt;&lt;/h2&gt;
&lt;b&gt;專案範本：&lt;/b&gt;&lt;br /&gt;
其所放置的路徑位在 IDE 根目錄下 &lt;b&gt;&quot;Project Templates&quot;&lt;/b&gt; 的資料夾下，其快取記錄則在 &lt;b&gt;&quot;ProjectTemplatesCache&quot;&lt;/b&gt; 資料夾底下。&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;項目範本：&lt;/b&gt;&lt;br /&gt;
其所放置的路徑位在 IDE 根目錄下&lt;b&gt; &quot;Item Templates&quot;&lt;/b&gt; 的資料夾下，其快取記錄則在 &lt;b&gt;&quot;ItemTemplatesCache&quot;&lt;/b&gt; 資料夾底下。&lt;br /&gt;
&lt;br /&gt;
以上 IDE 的根目錄 如果以 Visual Studio 2012 為例，其預設位置為 &lt;b&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\

&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
快取目錄底下會放置一個名稱為 cache.bin 的隱藏檔案，負責統計及快取所有的樣板檔案，如果有變更預設範本的內容，則在 Cache 資料夾相同檔案也要更新，連同 cache.bin 也要更新。&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;2. 使用者客製的範本&lt;/span&gt;&lt;/h2&gt;
其「使用者專案範本」及「使用者項目範本」所放置的路徑是可以自己自訂的，其設定介面在 Visual Studio 的「工具」→「選項...」→「專案和方案」→「一般」的畫面上。&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGEYYw8Ndcvs53CLEpxwoFvfOSh885Qf0h53K81YIhV9cDG_IBsn-ntDH0l-ayw_M2uv2TWB4WlFMDRkIrMu7JeAP2XrSZsjXQSU3rMLYXBMbIfjqBeYBoTKB0BT0EIFPLfGeS/s400/%E8%87%AA%E8%A8%82%E7%AF%84%E6%9C%AC%E5%84%B2%E5%AD%98%E4%BD%8D%E7%BD%AE%E8%A8%AD%E5%AE%9A%E7%95%AB%E9%9D%A2.jpg&quot; /&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;
如何客製化自己的範本？&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
最簡單的方式是先透過已知的範本修改，修改完後在 Visual Studio 的「檔案」→「匯出範本...」的精靈製作出範本檔。&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;303&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr2anxhvLGIrVi9-dgdKwVDRiSJIToqr_oWac-mAy0KbrXcWH-QVI5T_kZzj1-beQ6409WhfW05jgv6_hXPXLH9Vt_dCtaXo4nTWTzQhyphenhyphen7IOYc81oASHGr_AETU5K_akdN43W6/s400/%E8%87%AA%E8%A8%82%E7%AF%84%E6%9C%AC%E5%8C%AF%E5%87%BA%E7%B2%BE%E9%9D%88.jpg&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;3.&amp;nbsp;&lt;b&gt;VISX 擴充套件安裝的範本&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
其安裝後的位置以 Visual Studio 2012 為例是在&amp;nbsp;C:\Users\&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;使用者名稱&lt;/span&gt;&lt;/b&gt;\AppData\Local\Microsoft\VisualStudio\11.0\Extensions\ 底下，每個套件都以亂碼的資料夾來命名。&lt;br /&gt;
&lt;br /&gt;
&lt;img border=&quot;0&quot; height=&quot;241&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo7iieaBV1OM-Tg9DV1xHmznxmt9oWFTv-uUjx5h1K3OCJ849iVrjFaiHlmVUae5vER0lOOqPPTyenUGL8ao0Sz_KpvHHLJJoXswr_-yRRyRDILFwh9DeeoF9IP1vWla3xSXTf/s400/VSIX+%E6%93%B4%E5%85%85%E5%A5%97%E4%BB%B6%E5%AE%89%E8%A3%9D%E8%B7%AF%E5%BE%91.jpg&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;專案範本&quot; 及 &quot;項目範本&quot; 都在自己的套件資料夾底下放置，其位置可透由自己套件下的 extension.vsixmanifest 檔案來指定。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;VSIX 在 Visual Studio 的初始流程&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
當 VS 每次啟動時 → 都會重新檢查 Extensions 資料夾 → 讀取 Extensions 套件資料及套件資料結構並存到 extensions.zh-TW.cache 檔案 → 解壓縮 template 資料到 VTC 資料夾 → 將 extensions.zh-TW.cache 資料存到記憶體 供 Visual Studio 使用。&lt;br /&gt;
&lt;br /&gt;
一般 VSIX 的範本資源會以 zip 的形式壓縮在一起，初始的時候會將這 zip 檔解壓縮到&amp;nbsp;VTC&amp;nbsp;資料夾所規劃的位置上，以供系統快取範本之用。&lt;br /&gt;
&lt;br /&gt;
以上為 Visual Studio 各類型的範本的使用說明，希望這篇文章能協助你在修改 Visual Studio 的範本時能順利的應用。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/6411926957145734169/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/09/visual-studio.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/6411926957145734169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/6411926957145734169'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/09/visual-studio.html' title='Visual Studio 各類型範本的使用說明'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrRnaG7IPB1ctGHFCwDnycd8JKpvgTU-3f9wgrESAsmQKVCIBRe-Ufv8I9vhU3B0jXbj99yUJ1-S1_Bk2jrutHSJSdWIxo602ZbKH4BwphEncNMAD_iai4fARxkmOEtjPK9YK1/s72-c/%E7%AF%84%E6%9C%AC%E5%88%86%E9%A1%9E%E8%B3%87%E6%96%99%E5%A4%BE.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-3683516969453565170</id><published>2013-08-24T16:54:00.001+08:00</published><updated>2013-08-24T16:54:50.658+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MsSql"/><title type='text'>透過 SQL Server Management Studio 變更 Sql 資料及記錄檔預設的儲存位置</title><content type='html'>開發專案時，有時需要新建一個 database 來存取資料，而公司規定存放資料庫的位置，不一定是 MS SQL 預設的位置，因此常常在新增資料庫時，都需要記得變更記錄檔儲存的位置，這樣實在很麻煩...後來找到可以透過 SQL Server Management Studio 可以設定 sql 資料預設的儲存位置，以下為設定的方法：&lt;br /&gt;
&lt;div class=&quot;subSection&quot;&gt;
&lt;ol&gt;
&lt;li&gt;
                  
                    &lt;span class=&quot;sentence&quot; data-guid=&quot;b81cf6409f46a985448cd7f8e124112e&quot; data-source=&quot;In Object Explorer, right-click a server and click &amp;lt;span class=&amp;quot;label&amp;quot;&amp;gt;Properties&amp;lt;/span&amp;gt;.&quot; id=&quot;mt10&quot;&gt;
                      &lt;b&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;在 [物件總管] 中，選擇伺服器圖示然後按右鍵，然後再按一下 &lt;span class=&quot;label&quot;&gt;[屬性]&lt;/span&gt;。
                    &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
                  &lt;/span&gt;&lt;br /&gt;

                
                  &lt;/b&gt;&lt;/li&gt;
&lt;b&gt;
&lt;/b&gt;
&lt;li&gt;
                    &lt;b&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span class=&quot;sentence&quot; data-guid=&quot;36c6a987b1dcd04f960b00905ed23297&quot; data-source=&quot;In the left panel, click the &amp;lt;span class=&amp;quot;label&amp;quot;&amp;gt;Database settings&amp;lt;/span&amp;gt; page.&quot; id=&quot;mt11&quot;&gt;
                      在左面板中，按一下 &lt;span class=&quot;label&quot;&gt;[資料庫設定]&lt;/span&gt; 頁面。
                    &lt;/span&gt;&lt;/span&gt;
                  &lt;/b&gt;

                
                  &lt;/li&gt;
&lt;b&gt;
&lt;/b&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
                    &lt;span class=&quot;sentence&quot; data-guid=&quot;eebe35d41459050db6d4e5626b056301&quot; data-source=&quot;In &amp;lt;span class=&amp;quot;label&amp;quot;&amp;gt;Database default locations&amp;lt;/span&amp;gt;, view the current default locations for new data files and new log files.&quot; id=&quot;mt12&quot;&gt;
                      在 &lt;span class=&quot;label&quot;&gt;[資料庫預設位置]&lt;/span&gt; 中，您可以檢視新資料檔和新記錄檔的目前預設位置。
                    &lt;/span&gt; &lt;span class=&quot;sentence&quot; data-guid=&quot;010610af0f514e554736321de64ab0b3&quot; data-source=&quot;To change a default location, enter a new default pathname in the &amp;lt;span class=&amp;quot;label&amp;quot;&amp;gt;Data&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;label&amp;quot;&amp;gt;Log&amp;lt;/span&amp;gt; field, or click the browse button to find and select a pathname.&quot; id=&quot;mt13&quot;&gt;若要變更預設位置，在 &lt;span class=&quot;label&quot;&gt;[資料]&lt;/span&gt; 或 &lt;span class=&quot;label&quot;&gt;[記錄]&lt;/span&gt; 欄位中輸入新的預設路徑名稱，或按一下 [瀏覽] 按鈕來尋找並選取路徑名稱。&lt;/span&gt;&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;

                &lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/3683516969453565170/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/08/sql-server-management-studio-sql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3683516969453565170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3683516969453565170'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/08/sql-server-management-studio-sql.html' title='透過 SQL Server Management Studio 變更 Sql 資料及記錄檔預設的儲存位置'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-776370769785696523</id><published>2013-02-17T17:09:00.002+08:00</published><updated>2013-02-17T17:16:23.921+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET"/><title type='text'>透過 jquery ajax() 來呼叫 .NET Web Service 的方法</title><content type='html'>用 jquery 的 ajax() 方法呼叫 .net web service 有二種情況比較需要討論：&lt;br /&gt;
&lt;br /&gt;
1. 如何取得複雜型別的資料 &lt;br /&gt;
2. 如何回傳帶有參數的方法 &lt;br /&gt;
&lt;br /&gt;
這二種狀況是比較多人不知道怎麼設計的，以下將就這二種情況分別說明如何實作：&lt;br /&gt;
&lt;br /&gt;
首先我們先實作 web service 的方法，最簡單的方式就是可以在 Page 頁面上實作&lt;br /&gt;
Web Method ，實作上須注意三個重點：&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;1. Method 一定要是靜態 (static) 方法&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;2. 請記得在方法上加入 WebMethodAttribute 此 Meta 屬性&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;3. 無法用多載的方式來命名相同的方法名稱&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
這三個設計 Web Method 的規則沒有遵守的話，就會發生 Server Error 情況產生。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 接下來將展示要 demo 的程式碼，以下為 .cs 所要實作的部份：&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;pre class=&quot;brush:csharp&quot;&gt;using System;
using System.Web.Services;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    [WebMethod]
    public static User GetUser()
    {
        return new User() { FirstName = &quot;小明&quot;, LastName = &quot;王&quot;, };
    }

    [WebMethod]
    public static string GetFullName(User data)
    {
        return GetFullName2(data.FirstName, data.LastName);
    }

    [WebMethod]
    public static string GetFullName2(string firstName, string lastName)
    {
        string fullName = lastName + firstName;

        if(string.IsNullOrEmpty(fullName))
            return &quot;請在姓、名的文字方塊上輸入想要計算的名稱。&quot;;
        else
            return fullName;
    }
}

public class User
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}
&lt;/pre&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; 接下來在 .aspx 上撰寫所要呈現的介面：&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;User 資料
&lt;div style=&quot;border-bottom: 1px solid gray; border-top: 1px solid gray; margin: 5px 0px; padding: 5px 0px; width: 400px;&quot;&gt;
姓：&lt;input id=&quot;txbLastName&quot; style=&quot;width: 100px;&quot; type=&quot;text&quot; /&gt;
名：&lt;input id=&quot;txbFirstName&quot; style=&quot;width: 100px;&quot; type=&quot;text&quot; /&gt;

&lt;/div&gt;
&lt;input onclick=&quot;getData();&quot; type=&quot;button&quot; value=&quot;取得 User 資料&quot; /&gt;

&lt;input onclick=&quot;getFullName(1);&quot; title=&quot;透過 Server 端計算 User 全名&quot; type=&quot;button&quot; value=&quot;計算全名方法1&quot; /&gt;

&lt;input onclick=&quot;getFullName(2);&quot; title=&quot;透過 Server 端計算 User 全名&quot; type=&quot;button&quot; value=&quot;計算全名方法2&quot; /&gt;
&lt;/pre&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;然後一樣在 .aspx 上撰寫 javascript 程式碼，請記得到參考 jquery.js 的檔案：&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;&lt;script src=&quot;Scripts/jquery-1.9.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/pre&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; jquery.ajax 呼叫 .net web service 的實作：&lt;/b&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:js&quot;&gt;        &lt;script&gt;
            function user() {
                this.FirstName = &quot;&quot;;
                this.LastName = &quot;&quot;;
            };

            var userData = new user();
            var txbFirstName = $(&quot;#txbFirstName&quot;);
            var txbLastName = $(&quot;#txbLastName&quot;);

            function getData() {
                $.ajax({
                    type: &quot;POST&quot;,
                    url: &#39;Default.aspx/GetUser&#39;,
                    contentType: &quot;application/json; charset=utf-8&quot;,
                    dataType: &quot;json&quot;,
                    success: function (results) {
                        userData = results.d;

                        txbLastName.val(userData.LastName);
                        txbFirstName.val(userData.FirstName);
                    },
                    error: function (err) {
                        alert(err.status + &quot; - &quot; + err.statusText);
                    }
                });
            }

            function getFullName(mode) {
                var jsonData;
                var wsUrl;

                userData.FirstName = txbFirstName.val();
                userData.LastName = txbLastName.val();

                switch (mode) {
                    case 1:
                        jsonData = JSON.stringify({ data: userData }, null, null);
                        wsUrl = &quot;Default.aspx/GetFullName&quot;;
                        break;
                    case 2:
                        jsonData = JSON.stringify({
                            firstName: userData.FirstName,
                            lastName: userData.LastName
                        }, null, null);
                        wsUrl = &quot;Default.aspx/GetFullName2&quot;;
                        break;
                }

                $.ajax({
                    type: &quot;POST&quot;,
                    url: wsUrl,
                    contentType: &quot;application/json&quot;,
                    data: jsonData,
                    success: function (result) {
                        alert(result.d);
                    }
                });
            }
        &lt;/script&gt;
&lt;/pre&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;說明一下&amp;nbsp; javascript 程式碼的功能用途：&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt;getData()&lt;/b&gt;&lt;/span&gt; 方法是用來展示從 server side 取得複雜型別物件的範例，從 Web Method&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;取得的過程中，物件已序列化成 json , 而從 ajax 委派 sucess 的事件中，參數 results.d 則已經可以取得傳回的物件, 屬性取得的方式，則為原 User 類別上的屬性名稱。&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt;getFullName()&lt;/b&gt;&lt;/span&gt; 方法則是展示如何傳遞帶有參數的方法回去，這邊的重點在於&lt;span style=&quot;color: red;&quot;&gt;傳遞回去的物件，其 &lt;span style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;屬性名稱&quot; 必須要跟 Web Method 裡的 &quot;參數名稱&quot; 要一樣&lt;/span&gt;，否則傳遞回去會發生找不到相對應的參數值的錯誤，過程中，傳遞回去須先序列化成 json ，可透由 javascript 的 JSON.stringify() 方法來達成， 到了 server 端 .net 會自動幫你轉回你參數上的型別。&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/776370769785696523/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/02/jquery-ajax-net-web-service.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/776370769785696523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/776370769785696523'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/02/jquery-ajax-net-web-service.html' title='透過 jquery ajax() 來呼叫 .NET Web Service 的方法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-2566060660689538744</id><published>2013-02-17T05:43:00.000+08:00</published><updated>2013-02-17T05:43:28.008+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VisualStudio"/><title type='text'>解決：Intellisense and error highlighting not working  in VS 2012</title><content type='html'>先前在用 Visual Studio 2012 開發專案時，發現到當我語法有錯誤時，IDE 並沒有自動提示我哪邊有出錯，必須每次都要在建置專案時才知道哪邊有錯誤，而且修改完後，錯誤清單也不會把修正好的那一條清除掉，也是一樣要等建置完才會清除，我原本還以為是 vs 2012 的版本改成這樣的機制，想說怎越改越差… 後來才發現原來是我的 IDE 出了問題 orz...&lt;br /&gt;
&lt;br /&gt;
問題的原因可能是出在當初安裝完 vs 2012 的時候，它有詢問我 &quot;使用者的環境設定&quot; 是否要從 vs 2010 轉移過來，當然我是按下了確定，想說就不用還要重新設定我習慣的環境，結果可能是因為這樣才導致出了問題，似乎也有可能因為在 vs 2010 上裝了某些擴充套件 (例如：&lt;span class=&quot;comment-copy&quot;&gt;resharper)，也會導致類似像這樣問題的發生。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;comment-copy&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;comment-copy&quot;&gt;解決辦法就是：到 vs 2012 的 工具列上選 「工具」→「匯入和匯出設定...」進入後，&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;comment-copy&quot;&gt;再選擇「重設所有設定」選項並完成後續步驟後，重新啟動軟體應該就可以解決了。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;comment-copy&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;comment-copy&quot;&gt;如果再不行的話，&lt;/span&gt;可到&lt;span style=&quot;font-size: small;&quot;&gt;：&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;%AppData%\Roaming\Microsoft\VisualStudio\11.0\ReflectedSchemas&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;這個資料夾底&lt;span style=&quot;font-size: small;&quot;&gt;下，將裡面的檔案全&lt;span style=&quot;font-size: small;&quot;&gt;部刪除，然後重&lt;span style=&quot;font-size: small;&quot;&gt;新啟動 vs 2012 試試。&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;以上的方法，也&lt;span style=&quot;font-size: small;&quot;&gt;可以解&lt;span style=&quot;font-size: small;&quot;&gt;決 Intellisense 無法自動觸發的問題，&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;希望&lt;span style=&quot;font-size: small;&quot;&gt;其它人有遇到類似像我有這樣&lt;span style=&quot;font-size: small;&quot;&gt;問題的人，&lt;/span&gt;&lt;/span&gt; 上述的的&lt;span style=&quot;font-size: small;&quot;&gt;解法方法&lt;/span&gt;能夠幫助到你。&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/2566060660689538744/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/02/intellisense-and-error-highlighting-not.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/2566060660689538744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/2566060660689538744'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/02/intellisense-and-error-highlighting-not.html' title='解決：Intellisense and error highlighting not working  in VS 2012'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-7371145111541224674</id><published>2013-01-18T14:38:00.000+08:00</published><updated>2013-01-18T16:47:43.927+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET"/><title type='text'>Solution：無法從 &#39;System.Web.UI.HtmlControls.HtmlGenericControl&#39; 轉換為 &#39;System.Web.UI.HtmlControls.HtmlTableRow&#39; </title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;當 ASP .NET 專案從 Visual Studio 2010 轉到 Visual Studio 2012 開發後，在  compile 專案時，發生了以下的錯誤：&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: red; font-size: small;&quot;&gt;&amp;nbsp;無法從 &#39;System.Web.UI.HtmlControls.HtmlGenericControl&#39; 轉換為 &#39;System.Web.UI.HtmlControls.HtmlTableRow&#39;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;這是由於 aspx 有使用 table   tag&amp;nbsp; 並設定 runat=&#39;server&#39; 的屬性，接著使用了 thead   或 tbod&lt;span style=&quot;font-size: small;&quot;&gt;y&lt;/span&gt;  &lt;thbody&gt; 的 tag，才造成這樣錯誤。&lt;/thbody&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;thbody&gt;此錯誤是由於&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/thbody&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;thbody&gt;&lt;/thbody&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;NET Framework 4.5 的 bug 所引起來的，解決方法就是把 &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;thead   &lt;/span&gt;&lt;/span&gt;  &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;或是 &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;tbod&lt;span style=&quot;font-size: small;&quot;&gt;y&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 移除掉，這樣錯誤應該就不會再發生。&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;如果錯誤仍然存在，目前微軟已發出一個&lt;a href=&quot;http://support.microsoft.com/kb/2750147&quot; target=&quot;_blank&quot;&gt;修正檔&lt;/a&gt;，可解決上述的問題，並修正其它問題。&lt;/span&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/7371145111541224674/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2013/01/solution-systemwebuihtmlcontrolshtmlgen.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/7371145111541224674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/7371145111541224674'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2013/01/solution-systemwebuihtmlcontrolshtmlgen.html' title='Solution：無法從 &#39;System.Web.UI.HtmlControls.HtmlGenericControl&#39; 轉換為 &#39;System.Web.UI.HtmlControls.HtmlTableRow&#39; '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-30275573630644856</id><published>2012-01-24T23:16:00.001+08:00</published><updated>2012-01-24T23:17:37.255+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework"/><title type='text'>What is Entity Framework with POCO?</title><content type='html'>透過 EF 這個 ORM 的資料存取，我們常會看到使用 POCO 的範本來設計，那何謂 POCO 呢？它的全名為： Plain Old CLR Object ，中文我認為可翻成「簡單的資料物件」，故名思義就是這物件只定義屬性(property)，而不去定義跟其它物件互動的方法(method)或是事件(event)，使得開發人員可專注在商務邏輯的開發與脫離框架的單元測試，它的好處就是簡單且靈活度高，靈活度高意指的是它可擴展成多種用途，像是以下的這些情境：&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;當我們需要擴展成 Persistent Object (持久層物件，即可將物件的資訊或狀態記錄下來，儲存的方式有 Db、XML等)時，我們只要 Mapping 好資料庫與物件之間的定義並實現 CRUD 方法的接口即可使用。&lt;/li&gt;
&lt;li&gt;為 POCO 增加商務邏輯的方法(Ex：驗證密碼、計算價格)之後，就成為 Domain Model。&lt;/li&gt;
&lt;li&gt;當 POCO 含有資料綁定的功能，即為 View Data，可讓 UI 作為資料顯示的用途。&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
結論就是，POCO 相對於 ORM 而言，開發者可將 PO (Persistent Object ) 當作 POCO 來使用，而感覺不到 PO 的存在。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考資料：&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;&lt;a href=&quot;http://kb.cnblogs.com/page/89526/&quot;&gt;理解POCO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.dotblogs.com.tw/regionbbs/archive/2010/01/27/netfx.4.0.new.feature.ado.net.entity.framework.2.0.persistence.ignorant.object.overview.aspx&quot; target=&quot;_blank&quot;&gt;[VS2010] ADO.NET Entity Framework 新功能：永續儲存無知物件 (Persistence-Ignorant Object) Overview&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/30275573630644856/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2012/01/what-is-entity-framework-with-poco.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/30275573630644856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/30275573630644856'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2012/01/what-is-entity-framework-with-poco.html' title='What is Entity Framework with POCO?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-1265361811665416977</id><published>2012-01-12T12:23:00.001+08:00</published><updated>2012-01-12T12:23:34.335+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Active Directory"/><title type='text'>如何移除 Server 2008  AD LDS 的執行個體的服務</title><content type='html'>有時在 AD LDS (Active Directory 輕量型目錄服務) 上為了測試等其它原因有可能會加入新的執行個體的服務,但是如果要移除它要怎麼作呢？
原來在「開始 → 控制台 → 程式與功能」裡的安裝項目列表內可以找到我們所新增的執行個體的服務項目。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOVF_ZUHM2y-0MlG9jiwNHqQPjDNQxZtq5iPHqH74EFynhD5CBIQLx3HT1t-bZ510M6cupLApTiKM_k8nDi3T9-vF1BCHgfF6bS3VC5lb-4V1TbwQhfB7qVbcI47TRf2JWWeIk/s1600/Snap2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOVF_ZUHM2y-0MlG9jiwNHqQPjDNQxZtq5iPHqH74EFynhD5CBIQLx3HT1t-bZ510M6cupLApTiKM_k8nDi3T9-vF1BCHgfF6bS3VC5lb-4V1TbwQhfB7qVbcI47TRf2JWWeIk/s320/Snap2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
找到你當初所命名的執行個體的服務名稱，執行解除安裝的程序就可以移除了。&lt;br /&gt;
&lt;br /&gt;
p.s.&amp;nbsp; 如果你已停止了執行個體的服務，則移除時會出現下列圖片的警告畫面，建議是讓服務是在啟用的狀態下再來移除服務會是比較好的作法。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglWMWh8UWt-EPKChJNBi01khqYwmaylbUyYhqg2BfE60MbeJr-NhW6s11SibIVpethMXwjMdFIfb8p2AE8afVQjWx96w90leqwUfVe1qannlQIarRYKV47MQAfK7WQu9ZG3OoT/s1600/Snap3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;116&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglWMWh8UWt-EPKChJNBi01khqYwmaylbUyYhqg2BfE60MbeJr-NhW6s11SibIVpethMXwjMdFIfb8p2AE8afVQjWx96w90leqwUfVe1qannlQIarRYKV47MQAfK7WQu9ZG3OoT/s320/Snap3.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/1265361811665416977/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2012/01/server-2008-ad-lds.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1265361811665416977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1265361811665416977'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2012/01/server-2008-ad-lds.html' title='如何移除 Server 2008  AD LDS 的執行個體的服務'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOVF_ZUHM2y-0MlG9jiwNHqQPjDNQxZtq5iPHqH74EFynhD5CBIQLx3HT1t-bZ510M6cupLApTiKM_k8nDi3T9-vF1BCHgfF6bS3VC5lb-4V1TbwQhfB7qVbcI47TRf2JWWeIk/s72-c/Snap2.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-5545465380380696117</id><published>2011-11-18T21:15:00.002+08:00</published><updated>2011-11-28T02:42:24.636+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>如何加入 &quot;完全控制&quot; 的權限以刪除或編輯已受限制的註冊表</title><content type='html'>當你要刪除或編輯已受限制的 Windows 註冊表(Windows Registry)時，時常會跳出一個錯誤視窗，上面顯示著：&quot;不能刪除 xxx:當刪除機碼時發生錯誤&quot;，這表示你目前的帳戶沒有權限可以刪除這個機碼，解決的辦法是將的你帳戶開啟「完全控制(Full Control)」的權限才能使用，以下為設定的步驟：&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
1. 執行 regedit.exe 以開啟註冊表&lt;br /&gt;
2. 點選你要設定 &quot;完全控制&quot; 權限的機碼並按右鍵選擇「使用權限(P)...」的選項&lt;br /&gt;
3. 進入權限設定的介面並點選「進階(V)」的按鈕。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNy-9tGGMfunbxk9-BXX9EZQ6n1Hgq20GJeyohFLJlWP8K8_Yy9e20a90FuBDh1OHL1NlY3pYY5wc4jWwbGauvo6I6cL_g-bQz5MIUos1YVsKInp5prVunKAq9gBDRtZROs3Bg/s1600/Snap4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNy-9tGGMfunbxk9-BXX9EZQ6n1Hgq20GJeyohFLJlWP8K8_Yy9e20a90FuBDh1OHL1NlY3pYY5wc4jWwbGauvo6I6cL_g-bQz5MIUos1YVsKInp5prVunKAq9gBDRtZROs3Bg/s320/Snap4.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
4. 選擇「擁有者」的 Tab 之後，在 &quot;變更擁有者為：&quot; 內容裡選擇你目前作業系統所登入的帳戶，之後再勾選 &quot;取代子容器與物件的擁有者&quot; 然後按下「確定」按鈕。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyEA9NTUAwwrRfyXZTRE8zg7s7NzhxXlIWQXNtbKlO8gs9_1xVvxPEWCGHB87595yvkPFR12SppN-XDBml_a22JXZHRxPWaYgldLFVw0RxLlJHJ-mOHMKKk3yhOOQojwtjooux/s1600/Snap6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyEA9NTUAwwrRfyXZTRE8zg7s7NzhxXlIWQXNtbKlO8gs9_1xVvxPEWCGHB87595yvkPFR12SppN-XDBml_a22JXZHRxPWaYgldLFVw0RxLlJHJ-mOHMKKk3yhOOQojwtjooux/s320/Snap6.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
5. 現在你再次回到權限設定的視窗。如果作業系統為 Windows XP 則選擇 EveryOne 帳戶並勾選允許 &quot;完全控制&quot;;如果為 Vista 以上的作業總統則選擇你目前登入帳戶所屬的角色群組並勾選允許 &quot;完全控制&quot;。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrQnfi73kzkftwTOwg5jWoOC6HVHUrIxx3ByiXA2Ej6JEqKVUk131jg7bmOXTKRt1d4Dae8uprRNrwxQQ0fC64VdTuDNZwy4snIX9WWGD8ruUbVb3rUVCXeORBii24fHqdBeLA/s1600/Snap7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrQnfi73kzkftwTOwg5jWoOC6HVHUrIxx3ByiXA2Ej6JEqKVUk131jg7bmOXTKRt1d4Dae8uprRNrwxQQ0fC64VdTuDNZwy4snIX9WWGD8ruUbVb3rUVCXeORBii24fHqdBeLA/s320/Snap7.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
以上設定完後你就可以刪除或修改已受到限制的機碼。</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/5545465380380696117/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2011/11/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/5545465380380696117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/5545465380380696117'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2011/11/blog-post.html' title='如何加入 &quot;完全控制&quot; 的權限以刪除或編輯已受限制的註冊表'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNy-9tGGMfunbxk9-BXX9EZQ6n1Hgq20GJeyohFLJlWP8K8_Yy9e20a90FuBDh1OHL1NlY3pYY5wc4jWwbGauvo6I6cL_g-bQz5MIUos1YVsKInp5prVunKAq9gBDRtZROs3Bg/s72-c/Snap4.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-5438179217014638909</id><published>2011-11-18T20:06:00.002+08:00</published><updated>2011-11-18T20:26:09.261+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>解決顯示「開啟或關閉 Windows 功能」時，列表為空白的問題</title><content type='html'>最近在 Windows 7 的作業系統想為 IIS 開啟一些功能，於是就到「控制台」→「程式或功能」的「開啟或關閉 Windows 功能」(或是執行 optionalfeatures.exe 檔案)列表去選擇一些功能，結果發現列表變成空白而沒有既定的功能可讓我選擇：&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXN0C81lfMWhQAKERptQiIFWHTodwTdeYEeypWTsmRD5b1xQUTY4XrAEyc_gjCm4AKHnmibVpJVcwe2GmFbtEdAlmH83pMPSPJYce9dffHy_TFg9HUqkZT0o2QrC93rcquVVDQ/s1600/empty_list.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXN0C81lfMWhQAKERptQiIFWHTodwTdeYEeypWTsmRD5b1xQUTY4XrAEyc_gjCm4AKHnmibVpJVcwe2GmFbtEdAlmH83pMPSPJYce9dffHy_TFg9HUqkZT0o2QrC93rcquVVDQ/s320/empty_list.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
而微軟也發現了這問題，因此在 &lt;a href=&quot;http://support.microsoft.com/kb/931712/&quot;&gt;KB 931712&lt;/a&gt; 裡，提供了2個解決的方案，並且 google 了其它文章也有另外的解決辦法，不過遺憾的是這些解決方案一般都還是沒辦法消除這個問題，最有效的辦法就是重灌 Windows...，後來還是有在網路上找到一個有效解決的辦法，其解決步驟是：&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
第一步：&lt;a href=&quot;http://support.microsoft.com/kb/947821&quot;&gt;下載&lt;/a&gt; 系統更新整備工具，請根據你的作業系統版本來選擇下載。&lt;br /&gt;
&lt;br /&gt;
第二步：下載完畢後，先關閉其它正在執行的應用程式然後再執行這個更新檔，你會看到他試圖在安裝一些更新，其實他是在修正問題(他的背景處理程序是一個叫 checksur.exe 在運行著)，這個修正需要花一段時間，請耐心等候。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1cyRC4Xl_pZRPnXHykf_OTHIIwFrh0wjyzg-xFXyRyfpyNiSS_Sa1ecWtCHhW6jePOs5IXsV0ELafKq_DxfkdxPKIHW8CNL3cc4U-A1KVlUZngEu77bQAFaZmEuMReuIE1DoU/s1600/Snap2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;210&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1cyRC4Xl_pZRPnXHykf_OTHIIwFrh0wjyzg-xFXyRyfpyNiSS_Sa1ecWtCHhW6jePOs5IXsV0ELafKq_DxfkdxPKIHW8CNL3cc4U-A1KVlUZngEu77bQAFaZmEuMReuIE1DoU/s320/Snap2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
第三步：當安裝完成後，重新啟動你的電腦。&lt;br /&gt;
&lt;br /&gt;
第四步：電腦重新啟動完畢，再試試去使用「開啟或關閉 Windows 功能」看是否有修正成功，如果沒有就再往下一步動作。&lt;br /&gt;
&lt;br /&gt;
第五步：請執行 %windir%\Logs\CBS\CheckSUR.log 這個路徑，這時會用記事本開啟這個檔案，接下來的步驟會有些棘手，因為每個人的結果都不太相同。&lt;br /&gt;
&lt;br /&gt;
第六步：在這份記錄檔內找到 “Checking Package Manifests and catalogs” 這一行，下面則是列出這個分類有哪些問題，標示 (f) 代表有錯誤沒被修正，這一行內容包含錯誤代碼及所在路徑，而標示 (fix) 則代表剛安裝的更新檔已修正了部份的錯誤。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR4oBY6KWaI8B7ctX1y7u5NOgCyFmocsqWmm7aKCPUTcVJz8P-Gbx-ioejcuS1pdgNqSYQoVYP7tNTCioYhHrMBlXDAdPbeYxID5zfTN59bq2VWZTErCcpGfi6TU9hVmn4mSeH/s1600/Snap3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR4oBY6KWaI8B7ctX1y7u5NOgCyFmocsqWmm7aKCPUTcVJz8P-Gbx-ioejcuS1pdgNqSYQoVYP7tNTCioYhHrMBlXDAdPbeYxID5zfTN59bq2VWZTErCcpGfi6TU9hVmn4mSeH/s320/Snap3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
第七步：現在你必須根據那份 CheckSUR.log 所顯示的錯誤手動地刪除那些 registry keys。去啟動 regedit.exe 檔案並找到這個位置 → HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\ 而那些錯誤的 registry keys 就在這位置底下。&lt;br /&gt;
&lt;br /&gt;
舉個例子告訴你們如何刪除：有一行錯誤是顯示 Package_5_for_KB938979~31bf3856ad364e35~x86~~6.0.1.2.mum，所以我們透過剛講的位置應該會找到不帶副檔名 mum 這字串 Package_5_for_KB938979~31bf3856ad364e35~x86~~6.0.1.2 的鍵值，點選並刪除它。&lt;br /&gt;
&lt;br /&gt;
p.s. 你可能需要完整的權限(Full Control)才能將 registry keys 刪除。&lt;br /&gt;
&lt;br /&gt;
刪除已損壞的註冊表後，應該就可以把這個問題修正了，而關於 &quot;系統更新整備工具&quot; 這檔案，還有其它好處是它還修正了其它你可能不知道的問題，所以它是一個滿實用的工具，如果作業系統有問題可以先執行它看是否可把問題修復。</content><link rel='enclosure' type='' href='http://www.raymond.cc/blog/archives/2009/03/06/fix-blank-or-empty-list-in-vista-turn-windows-features-on-or-off-optionalfeaturesexe/' length='0'/><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/5438179217014638909/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2011/11/windows.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/5438179217014638909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/5438179217014638909'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2011/11/windows.html' title='解決顯示「開啟或關閉 Windows 功能」時，列表為空白的問題'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXN0C81lfMWhQAKERptQiIFWHTodwTdeYEeypWTsmRD5b1xQUTY4XrAEyc_gjCm4AKHnmibVpJVcwe2GmFbtEdAlmH83pMPSPJYce9dffHy_TFg9HUqkZT0o2QrC93rcquVVDQ/s72-c/empty_list.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-8662610682787189373</id><published>2011-11-14T17:26:00.002+08:00</published><updated>2011-11-14T17:30:09.969+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><category scheme="http://www.blogger.com/atom/ns#" term="X.509"/><title type='text'>解決 WCF 用程式載入 X.509 憑證服務而發生「 CryptographicException:發生內部錯誤」的問題</title><content type='html'>當透過程式載入 X.509憑證後並要取得 WCF 服務時，會發生下面的例外情況：&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDJCyHx2I3SStGue0cmM1-lhRC6raVQ-a3vD8dNPDo2eKhsdAXRJHoA6Rb4y_uMPqjAGu4uJ_Z65zTXisfWi0_bsZTS-ONj53m-0DLgcUSfwKn-XTHM2xohZAFwCazdpkvnYus/s1600/%25E7%2599%25BC%25E7%2594%259F%25E5%2585%25A7%25E9%2583%25A8%25E9%258C%25AF%25E8%25AA%25A4.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDJCyHx2I3SStGue0cmM1-lhRC6raVQ-a3vD8dNPDo2eKhsdAXRJHoA6Rb4y_uMPqjAGu4uJ_Z65zTXisfWi0_bsZTS-ONj53m-0DLgcUSfwKn-XTHM2xohZAFwCazdpkvnYus/s640/%25E7%2599%25BC%25E7%2594%259F%25E5%2585%25A7%25E9%2583%25A8%25E9%258C%25AF%25E8%25AA%25A4.jpg&quot; width=&quot;520&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
此問題的解決辦法是在載入 X.509 的類別上加入 &lt;span style=&quot;color:blue&quot;&gt;X509KeyStorageFlags.MachineKeySet&lt;/span&gt; 這個參數：&lt;br /&gt;
&lt;pre class=&quot;brush:c#&quot;&gt;X509Certificate2 certificate = new X509Certificate2(
     Server.MapPath(&quot;~/App_Code/WebService/cert/cert.pfx&quot;),  
     &quot;password&quot;, 
     X509KeyStorageFlags.MachineKeySet);
&lt;/pre&gt;目前測試就算 StoreLocation 為 CurrentUser，而使用 X509KeyStorageFlags.UserKeySet 或是其它的列舉值問題似乎仍然會發生，所以一定要設定 X509KeyStorageFlags.MachineKeySet 這個參數才能解決這個例外的錯誤，不知道網友是否知道這錯誤發生的原因…</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/8662610682787189373/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2011/11/wcf-x509-cryptographicexception.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8662610682787189373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8662610682787189373'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2011/11/wcf-x509-cryptographicexception.html' title='解決 WCF 用程式載入 X.509 憑證服務而發生「 CryptographicException:發生內部錯誤」的問題'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDJCyHx2I3SStGue0cmM1-lhRC6raVQ-a3vD8dNPDo2eKhsdAXRJHoA6Rb4y_uMPqjAGu4uJ_Z65zTXisfWi0_bsZTS-ONj53m-0DLgcUSfwKn-XTHM2xohZAFwCazdpkvnYus/s72-c/%25E7%2599%25BC%25E7%2594%259F%25E5%2585%25A7%25E9%2583%25A8%25E9%258C%25AF%25E8%25AA%25A4.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-1753511037538524716</id><published>2011-11-11T17:01:00.001+08:00</published><updated>2011-11-11T17:02:00.653+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><category scheme="http://www.blogger.com/atom/ns#" term="X.509"/><title type='text'>找到 X. 509 的憑證私鑰位置並為其加入 ACL 權限</title><content type='html'>有時候系統在存取 X.509 私鑰時因所使用的服務帳戶權限不足，而導致存取被拒的情況發生，因此一般人可能都會用像是 findprivatekey.exe 這類工具，來找出私鑰的位置並手動加入服務帳戶的權限才能解決這個問題，而這邊將說明如何透過程式來找出 private key 的位置，並且指定 account 自動加入 ACL 的權限。&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
首先，我們先設計出透過憑證找出私鑰的檔案資訊物件，此物件有此檔案的路徑位置資訊：&lt;br /&gt;
&lt;pre class=&quot;brush:c#&quot;&gt;private static FileInfo GetPrivateKeyFileInfo(X509Certificate2 cert)
    {
        RSACryptoServiceProvider rsa = cert.PrivateKey as RSACryptoServiceProvider;

        if (rsa != null)
        {
            string keyFileName = rsa.CspKeyContainerInfo.UniqueKeyContainerName;
            string comAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            string comAppDataForKeyPath = comAppDataPath + @&quot;\Microsoft\Crypto\RSA\MachineKeys&quot;;

            if (Directory.GetFiles(comAppDataForKeyPath, keyFileName).Length &gt; 0)
                return  new FileInfo(comAppDataForKeyPath + &quot;\\&quot; + keyFileName);

            string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string appDataForKeyPath = appDataPath + @&quot;\Microsoft\Crypto\RSA\&quot;;
            string[] dirArray = Directory.GetDirectories(appDataForKeyPath);

            if (Directory.GetDirectories(appDataForKeyPath).Length &gt; 0)
            {
                foreach (string dir in dirArray)
                {
                    if (Directory.GetFiles(dir, keyFileName).Length &gt; 0)
                        return new FileInfo(dir + &quot;\\&quot; + keyFileName);
                }
            }

            throw new Exception(&quot;Private key 存在，但找不到它的位置&quot;);
        }

        return null;
    }
&lt;/pre&gt;&lt;br /&gt;
再來就是設計指定某個帳戶為 private key 的檔案加入 ACL 的權限：&lt;br /&gt;
&lt;pre class=&quot;brush:c#&quot;&gt;private static void AddAccessToCertificate(X509Certificate2 cert, string user)
    {
        FileInfo keyFile = GetPrivateKeyFileInfo(cert);

        if (keyFile != null)
        {
            FileSecurity fs = keyFile.GetAccessControl();

            NTAccount account = new NTAccount(user);
            fs.AddAccessRule(
                new FileSystemAccessRule(account, FileSystemRights.FullControl, AccessControlType.Allow));

            keyFile.SetAccessControl(fs);
        }
    }
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/1753511037538524716/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2011/11/x-509-acl.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1753511037538524716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1753511037538524716'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2011/11/x-509-acl.html' title='找到 X. 509 的憑證私鑰位置並為其加入 ACL 權限'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-9153292248233477609</id><published>2011-11-10T11:37:00.002+08:00</published><updated>2011-11-14T16:31:32.700+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><category scheme="http://www.blogger.com/atom/ns#" term="X.509"/><title type='text'>解決透過程式新增 X.590 憑證(with private key)之後取不到相關私鑰資料的問題</title><content type='html'>最近要設計一個 WCF 的服務以方便透過它來取得資料，由於考量安全性的問題，所以需要設計一個驗證機制，檢核通過後才能取得資料，驗證過程則透過 X.509 來作加密的動作，因為客戶的主機要設定 X.509 的憑證不容易，因此想透過程式的方法來新增憑證，程式碼如下：  &lt;br /&gt;
&lt;pre class=&quot;brush:c#&quot;&gt;X509Store store = new X509Store(&quot;My&quot;, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);

if (store.Certificates.Find(
     X509FindType.FindBySubjectName, &quot;SubjectName&quot;, true).Count == 0)
{
     X509Certificate2 certificate = new X509Certificate2(
          Server.MapPath(&quot;~/App_Code/WebService/cert.pfx&quot;), &quot;password&quot;);

     store.Add(certificate);
}

store.Close();
&lt;/pre&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;在透過程式新增 X.509 憑證後，並使用 WCF 的服務時，則開始顯示下列的錯誤：  &lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;System.Security.Cryptography.CryptographicException: 機碼組不存在
&lt;/pre&gt;而使用 findprivatekey.exe 來找憑證的私鑰，卻得到 &lt;span style=&quot;color: red;&quot;&gt;Unable to obtain private key file name&lt;/span&gt; 的訊息。  研判是憑證與私錀沒有關連在一起，後來在 X509Certificate2 的建構式上找到一個多載方法： &lt;span style=&quot;color: #073763;&quot;&gt;X509Certificate2(String, String, X509KeyStorageFlags)&lt;/span&gt;  因此將載入憑證的程式碼改為： &lt;pre class=&quot;brush:c#&quot;&gt;X509Certificate2 certificate = new X509Certificate2(
     Server.MapPath(&quot;~/App_Code/WebService/cert/cert.pfx&quot;),  
     &quot;password&quot;, 
     X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
&lt;/pre&gt;就可以解決上述的問題。</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/9153292248233477609/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2011/11/x590-with-private-key.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/9153292248233477609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/9153292248233477609'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2011/11/x590-with-private-key.html' title='解決透過程式新增 X.590 憑證(with private key)之後取不到相關私鑰資料的問題'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-7709823433010045556</id><published>2010-10-05T12:19:00.002+08:00</published><updated>2011-11-09T02:03:57.302+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>找出 Table 記錄內重複的資料</title><content type='html'>此 sql 語法可以快速找到 Table 中重複的資料，以方便作後續的資料處理，&lt;br /&gt;
    以下為此語法的程式碼：
&lt;br /&gt;
&lt;pre class=&quot;brush:sql;&quot;&gt;select [column_name], count(*) as repeat_count --重複出現的次數
from [table_name]
group by [column_name] 
having count(*) &amp;lt; 1 --列出重複出現一次以上的資料

--[column_name]：要查詢重複的欄位名稱 
--[table_name]：所要查詢的資料表
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/7709823433010045556/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2010/10/table.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/7709823433010045556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/7709823433010045556'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2010/10/table.html' title='找出 Table 記錄內重複的資料'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Kaohsiung City, Taiwan</georss:featurename><georss:point>23.0108714 120.6660044</georss:point><georss:box>22.5431909 120.0342904 23.4785519 121.29771840000001</georss:box></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-3866182269647298518</id><published>2009-01-22T16:05:00.002+08:00</published><updated>2009-01-22T16:12:44.838+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP .NET"/><title type='text'>ASP .Net 網站「無法寫入輸出檔...存取被拒」的解決辦法</title><content type='html'>編譯器錯誤訊息: CS0016: 無法寫入輸出檔 &#39;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\serverweb\ccbf989a\1da6eaac\App_Web_login.aspx.cdcab7d2.ztyjs3jv.dll&#39; -- &#39;存取被拒。&lt;br /&gt;&lt;br /&gt;如果類似遇到這樣的情況，就代表暫存資料夾的權限不夠，&lt;br /&gt;&lt;br /&gt;許多網路上的文章都是寫要設定 Windows 的 temp 目錄&lt;br /&gt;或是Temporary ASP.NET Folder 這些目錄的存取權限。&lt;br /&gt;&lt;br /&gt;Winddows XP 要設給 IIS_ISURS 使用者&lt;br /&gt;Windows 2000 要設給 ASPNET&lt;br /&gt;Windows Server 2003 要設給 Network Service&lt;br /&gt;&lt;br /&gt;權限控制設成→「完全控制」。(我還沒試過不設到完全控制可不可行)&lt;br /&gt;&lt;br /&gt;基本上就可以解決上述的錯誤發生。</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/3866182269647298518/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2009/01/asp-net.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3866182269647298518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3866182269647298518'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2009/01/asp-net.html' title='ASP .Net 網站「無法寫入輸出檔...存取被拒」的解決辦法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-9164552145128814650</id><published>2008-12-29T04:28:00.000+08:00</published><updated>2008-12-29T04:28:29.129+08:00</updated><title type='text'>Page not found using ASP.NET Development server - ASP.NET Forums</title><content type='html'>&lt;a href=&quot;http://forums.asp.net/t/987980.aspx&quot;&gt;Page not found using ASP.NET Development server - ASP.NET Forums&lt;/a&gt;: &quot;&lt;br /&gt;&lt;br /&gt;i had the same problem and here is its fix,&lt;br /&gt;&lt;br /&gt;as u have Eset nod32 antivirus v3.0.621 (same as me) , the problem is from this AV that dont allow connections to be made to Visual Studio ASP.NET Server .&lt;br /&gt;&lt;br /&gt;now follow these steps to solve this issue:&lt;br /&gt;&lt;br /&gt; 1.&lt;br /&gt;    DoubleClick on Nod32 icon on tray and Open it up.&lt;br /&gt; 2.&lt;br /&gt;    if it is not in &#39;Advanced Mode&#39; , switch to Advanced Mode. ( you can do it by clicking on the bottom-left link &#39;Display:Standard Mode&#39; and then click on &#39;Toggle Advanced Mode&#39; )&lt;br /&gt; 3.&lt;br /&gt;    then goto SETUP section. then on the Right Pane click on &#39;Antivirus and Antispyware protection&#39;. the panel should be opened.&lt;br /&gt; 4.&lt;br /&gt;    now in the &#39;Web Access protection&#39; click on &#39;Configure...&#39;&lt;br /&gt; 5.&lt;br /&gt;    from the left Tree go to path : &#39;Web access protection &amp;gt; HTTP &amp;gt; Web Browsers&#39;&lt;br /&gt; 6.&lt;br /&gt;    now you should see visual studio 8 &#39;devenv.exe&#39; in the list .&lt;br /&gt; 7.&lt;br /&gt;    click on it twice till you see a cross sign in the box. ( Note on CROSS sign , not mark sign ! )&lt;br /&gt; 8.&lt;br /&gt;    with this cross sign you tell the Nod32 that this program should not be scanned and filtered for web access.&lt;br /&gt;&lt;br /&gt;due to this steps , my problem solved and now i can&quot;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/9164552145128814650/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/12/page-not-found-using-aspnet-development.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/9164552145128814650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/9164552145128814650'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/12/page-not-found-using-aspnet-development.html' title='Page not found using ASP.NET Development server - ASP.NET Forums'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-1700738754905467517</id><published>2008-09-05T10:39:00.004+08:00</published><updated>2008-09-05T17:27:28.021+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LDAP"/><title type='text'>LDAP 基本知識</title><content type='html'>&lt;ul&gt;&lt;br /&gt;&lt;li&gt;LDAP server will be listening on TCP port 389 which is the standard LDAP port.&lt;/li&gt;&lt;li&gt;LDAP is not&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;A general replacement for relational databases&lt;/li&gt;&lt;br /&gt;&lt;li&gt;A file system for very large objects&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Optimal for very dynamic objects&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Useful without applications&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A stand-alone server called Slapd. Slap was followed by a second service called Slurpd.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In a nutshell：&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Information in LDAP is logically represented as entries.&lt;/li&gt;&lt;li&gt;Entries belong to one or more object classes.&lt;/li&gt;&lt;li&gt;Each object class is defined by a set of attributes.&lt;/li&gt;&lt;li&gt;An attribute consists of a type and one or more values.&lt;/li&gt;&lt;li&gt;Object class and attribute type definitions make up the schema.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/1700738754905467517/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/09/ldap.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1700738754905467517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/1700738754905467517'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/09/ldap.html' title='LDAP 基本知識'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-649561413248572014</id><published>2008-06-22T15:58:00.017+08:00</published><updated>2011-11-09T11:12:40.286+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Attributes 的使用</title><content type='html'>之前我在自家公司的產品，有導入自己製作的 ORM (Object Relational Mapping)的資料處理底層類別，在 Data Entity 上有使用到 Attributes 的觀念。它跟一般大家所講的類別的屬性(Property)是不一樣的，它可以在類別(Class)、方法(Function)、成員(Member)、屬性(Property)上去定義這些元素的用途、或一個資訊。有點像是這些元素的中繼資料(Meta Data)，有興趣的朋友，可以到這個&lt;a href=&quot;http://www.brainbell.com/tutors/C_Sharp/Attributes.htm&quot;&gt;網站&lt;/a&gt;去了解一下，好了費話不多說，我就拿一個我在 MSDN 所看到的範例，來跟大家說明一下它可以作怎樣的運用：&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;pre class=&quot;brush:c#&quot;&gt;using System;
using System.Reflection;

namespace CustomAttrCS
{
    // An enumeration of animals. Start at 1 (0 = uninitialized).
    public enum Animal
    {
        // Pets.
        Dog = 1,
        Cat,
        Bird,
    }

    // 一個自訂的 attribute 能允許目標物定義一個 pet (繼承 Attribute 類別)
    public class AnimalTypeAttribute : Attribute
    {
        // 當這個 attribute 被設定時，這個建構子(constructor)會被呼叫
        public AnimalTypeAttribute(Animal pet)
        {
            thePet = pet;
        }

        // 設定一個內部的變數
        protected Animal thePet;

        // 設定一個公開的屬性...
        public Animal Pet
        {
            get { return thePet; }
            set { thePet = Pet; }
        }
    }

    // 一個測試類別，在每個方法上都定義一個它屬於的 pet
    class AnimalTypeTestClass
    {
        [AnimalType(Animal.Dog)]
        public void DogMethod() { }

        [AnimalType(Animal.Cat)]
        public void CatMethod() { }

        [AnimalType(Animal.Bird)]
        public void BirdMethod() { }
    }

    //以下示範如何使用 attribute
    class DemoClass
    {
        //以下用 Console 模式下運作
        static void Main(string[] args)
        {
            AnimalTypeTestClass testClass = new AnimalTypeTestClass();
            Type type = testClass.GetType();
            
            // 將 AnimalTypeTestClass 的方法透過 foreach 全部取出
            foreach (MethodInfo mInfo in type.GetMethods())
            {
                // 將每一個 function 透過 foreach 取得 attribute 的集合
                foreach (Attribute attr in
                    Attribute.GetCustomAttributes(mInfo))
                {
                    // 檢查是否為 AnimalType 的資料型態如果是將它列印出來
                    if (attr.GetType() == typeof(AnimalTypeAttribute))
                        Console.WriteLine(
                            &quot;Method {0} has a pet {1} attribute.&quot;,
                            mInfo.Name, ((AnimalTypeAttribute)attr).Pet);
                }

            }

            Console.In.ReadLine();
        }
    }
}

/*
 * 輸出結果:
 * Method DogMethod has a pet Dog attribute.
 * Method CatMethod has a pet Cat attribute.
 * Method BirdMethod has a pet Bird attribute.
 */&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/649561413248572014/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/06/c-attributes.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/649561413248572014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/649561413248572014'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/06/c-attributes.html' title='C# Attributes 的使用'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-3130293435738668615</id><published>2008-05-26T16:49:00.010+08:00</published><updated>2008-05-26T17:11:21.404+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Html"/><title type='text'>如何在網站上加上網站小圖示</title><content type='html'>我們可在網頁原始碼在 Head Tag 下加入如底下所示範的原始碼，修改 href 屬性，裡面的路徑為你的網站小圖示的檔案所在路徑，完成後即會在我的最愛或者是瀏覽器的網址列裡，可看到你網站上的小圖示。&lt;br /&gt;&lt;pre class=&quot;html&quot; name=&quot;code&quot;&gt;&lt;br /&gt;     &lt;Link rel=&quot;shortcut icon&quot; href=&quot;/images/ee.ico&quot; type=&quot;image/x-icon&quot;&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/3130293435738668615/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3130293435738668615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3130293435738668615'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/05/blog-post.html' title='如何在網站上加上網站小圖示'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-8754556566925909395</id><published>2008-05-07T18:36:00.003+08:00</published><updated>2011-11-09T02:05:33.563+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MsSql"/><title type='text'>解決 MsSql 安裝圖表失敗時的解決辦法</title><content type='html'>在 &lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;MsSql&lt;/span&gt; 資料庫中安裝圖表時會有二種情況下使得安裝失敗，&lt;br /&gt;
而失敗時則都會出現以下的錯誤訊息：&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;無法安裝資料庫圖表支援物件，因為此資料庫沒有有效的擁有者。若要繼續，請先使用 [資料庫屬性] 對話方塊的 [檔案] 頁面，或使用 ALTER AUTHORIZATION 陳述式，將資料庫擁有者設定為有效的登入，然後再加入資料庫圖表支援物件。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
以下為這二種失敗情況的解法方法：&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;情況一&lt;/span&gt;&lt;br /&gt;
資料庫必須在 SQL Server 2005 資料庫相容性層級中。如果資料庫的相容性層級不是 90，則當您嘗試安裝圖表支援時，就會發生錯誤。&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
您可以重設資料庫的相容性層級。使用下列 Transact-SQL 陳述式變更資料庫的相容性層級，然後再重試資料庫圖表作業。&lt;br /&gt;
&lt;br /&gt;
EXEC sp_dbcmptlevel &#39;&lt;span style=&quot;color: red;&quot;&gt;database_name&lt;/span&gt;&#39;, &#39;90&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;情況二&lt;/span&gt;&lt;br /&gt;
在已由另一個 SQL Server 執行個體附加或還原的資料庫上，這些支援物件的安裝可能會失敗。如果資料庫擁有者名稱 (儲存在資料庫中) 在資料庫附加或還原的目標 SQL Server 執行個體中不是有效的登入時，就有可能發生這種狀況。&lt;br /&gt;
請使用下列 Transact-SQL 陳述式，將資料庫擁有者改成 SQL Server 執行個體中的有效登入，然後再重試資料庫圖表作業。&lt;br /&gt;
&lt;br /&gt;
ALTER AUTHORIZATION ON DATABASE::&lt;span style=&quot;color: red;&quot;&gt;database_name&lt;/span&gt; TO &lt;span style=&quot;color: red;&quot;&gt;valid_login&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff9900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;以上撰寫 Transact-SQL 陳述式時，將 database_name 改成你資料庫名稱， valid_login 改成你登入SQL的帳號名稱即可。&lt;br /&gt;
&lt;br /&gt;
如果想要瞭解有關資料庫圖表的擁有權可連結此&lt;a href=&quot;http://technet.microsoft.com/zh-tw/library/ms186345.aspx&quot;&gt;文章&lt;/a&gt;看看。&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: #ff9900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/8754556566925909395/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/05/mssql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8754556566925909395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8754556566925909395'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/05/mssql.html' title='解決 MsSql 安裝圖表失敗時的解決辦法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Kaohsiung City, Taiwan</georss:featurename><georss:point>23.0108714 120.6660044</georss:point><georss:box>22.5431909 120.0342904 23.4785519 121.29771840000001</georss:box></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-5993522425678947446</id><published>2008-04-16T11:19:00.017+08:00</published><updated>2013-01-10T21:34:35.292+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="XPath"/><title type='text'>XPath 字串比較的問題解決</title><content type='html'>有次當我針對 XPath 作一個屬性值的判斷查詢時，如以下的語法：&lt;br /&gt;
&lt;pre class=&quot;brush:xslt&quot;&gt;
&lt;xsl:when test=&quot;@language = en_us&quot;&gt;
&lt;/xsl:when&gt;&lt;/pre&gt;
&lt;br /&gt;
發現這句語法沒辦法判斷，後來才發現原來字串在作比較時，其字串值前後須要加上單引號才能作判斷，如以下的語法：&lt;br /&gt;
&lt;pre class=&quot;brush:xslt&quot;&gt;
&lt;xsl:when test=&quot;@language = &#39;en_us&#39;&quot;&gt;
&lt;/xsl:when&gt;&lt;/pre&gt;
&lt;br /&gt;
就是這樣~~~ Case close</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/5993522425678947446/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/04/xpath_16.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/5993522425678947446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/5993522425678947446'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/04/xpath_16.html' title='XPath 字串比較的問題解決'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-8057901448858289791</id><published>2008-04-12T14:25:00.004+08:00</published><updated>2008-04-12T15:33:44.057+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="XPath"/><title type='text'>XPath 的路徑表達式</title><content type='html'>&lt;p&gt;最常見的XPath表達式是路徑表達式（XPath這一名稱的另一來源）。路徑表達式是由位置步驟所組成的，這些步驟是以「/」字元分開，而每一步驟則有三個要素所構成：&lt;/p&gt; &lt;ul&gt;&lt;li&gt;軸線（指出從語境節點開始，處理器會往哪個方向搜尋其它節點）&lt;/li&gt;&lt;li&gt;節點測試（指出在軸線上所要被選到的節點）&lt;/li&gt;&lt;li&gt;判斷式（用於篩選節點的屬性和子節點特徵）&lt;/li&gt;&lt;/ul&gt;以下為大家說明位置步驟的三要素：&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:180%;&quot; &gt;軸線&lt;/span&gt;&lt;br /&gt;XPath 有十三種軸線可供你在位置步驟使用：&lt;br /&gt;&lt;ul&gt;&lt;li&gt;child&lt;br /&gt;語境節點的所有子節點。這是內定的軸線。&lt;br /&gt;縮寫語法：預設，可被省略。&lt;/li&gt;&lt;li&gt;descendant&lt;br /&gt;包含在語境節點的所有節點，即是子節點、子節點的子節點、子節點的子節點的子節點等等都被包含在裡面。&lt;br /&gt;縮寫語法：無。&lt;/li&gt;&lt;li&gt;descendant-or-self&lt;br /&gt;語境節點的子孫節點或語境節點本身。&lt;br /&gt;縮寫語法：&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;/&lt;/span&gt;(總是位於其它代表根節點，或將此步驟和上一個步驟分離的反斜線之前)。&lt;/li&gt;&lt;li&gt;parent&lt;br /&gt;比自身節點深度少一層的節點，且需要包含自身的節點。&lt;br /&gt;縮寫語法：&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;..&lt;/span&gt;，但不能用於 XSLT 的 match 屬性。&lt;/li&gt;&lt;li&gt;ancestor&lt;br /&gt;比自身節點深度小的節點，且需要包含自身的節點。&lt;br /&gt;縮寫語法：無。&lt;/li&gt;&lt;li&gt;ancestor-or-self&lt;/li&gt;&lt;li&gt;following-sibling&lt;br /&gt;下一個同級節點。&lt;/li&gt;&lt;li&gt;preceding-sibling&lt;br /&gt;在語境節點的開端之前。&lt;/li&gt;&lt;li&gt;following&lt;br /&gt;在語境節點結束的開端。&lt;/li&gt;&lt;li&gt;preceding&lt;br /&gt;在語境節點開端之前。&lt;/li&gt;&lt;li&gt;attribute&lt;br /&gt;該語鏡節點的所有屬性。&lt;br /&gt;縮寫語法：&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;@&lt;/span&gt;&lt;/li&gt;&lt;li&gt;namespace&lt;br /&gt;在語境節點之有效範圍的所有名稱空間。&lt;/li&gt;&lt;li&gt;self&lt;br /&gt;語境節點本身。&lt;br /&gt;縮寫語法：&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;font-size:180%;&quot; &gt;節點測試&lt;/span&gt;&lt;br /&gt;每一個位置步驟至少有一個軸和一個節點測試(node test)。這個節點測試進一步定義了由位置步驟所選擇的節點。雙冒號(::)分隔了軸和節點測試。總共有七種節點測試：&lt;br /&gt;&lt;ul&gt;&lt;li&gt;name&lt;br /&gt;XML 文件中會符合所有具相同名稱之元素。&lt;/li&gt;&lt;li&gt;prefix:*&lt;/li&gt;&lt;li&gt;comment()&lt;br /&gt;所有的註解節點。&lt;/li&gt;&lt;li&gt;text()&lt;br /&gt;所有的文字節點。&lt;/li&gt;&lt;li&gt;procession-instruction()、procession-instruction(&#39;target&#39;)&lt;/li&gt;&lt;li&gt;node()&lt;br /&gt;會選擇所有的節點：屬性、名稱空間、元素、文字、註解、處理指示、根。&lt;/li&gt;&lt;li&gt;*&lt;br /&gt;會選取所有的元素節點，而不管其名稱為何。然而如果軸線是屬性軸線，則它會選取屬性節點，如果軸線是名稱空間軸線，它會選取所有的名稱空間節點。&lt;/li&gt;&lt;/ul&gt;判斷式&lt;br /&gt;每個節點測試可能零到多個判斷式 (predicate)。一個判斷式是用中括號包起來的 XPath 運算式。</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/8057901448858289791/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/04/xpath_12.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8057901448858289791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/8057901448858289791'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/04/xpath_12.html' title='XPath 的路徑表達式'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23037558.post-3054877417768893752</id><published>2008-04-12T13:46:00.005+08:00</published><updated>2008-04-12T14:17:04.744+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="XPath"/><title type='text'>XPath 資料類型(Data Type)</title><content type='html'>XPath 運算式所定義的資料型別有這四種：&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;布林值(boolean)&lt;/span&gt;：是個二進位的值，不是 true 就是 false。使用&lt;span style=&quot;font-weight: bold;&quot;&gt;比較運算子&lt;/span&gt;( =、!=、&lt;、&gt;、&lt;=、&gt;= )時，大都會產生布林值。而 XPath 不提供布林值的內容。不過，&lt;span style=&quot;color: rgb(255, 255, 51);&quot;&gt; &lt;span style=&quot;color: rgb(255, 102, 0);&quot;&gt;true()&lt;/span&gt; &lt;/span&gt;和 &lt;span style=&quot;color: rgb(255, 102, 0);&quot;&gt;false() &lt;/span&gt;函式可以滿足這項需求。&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;數字(number)&lt;/span&gt;：與 IEEE 754 相容之 64位元的浮點數，且可帶正、負號。數字也會包含一些特殊值，如：Inf (正無限大)、 -Inf (負無限大)以及 NaN (非數字)來表示不尚運算的結果，例如除以零時。XPath 提供一些運算子來計算數字：加號 (+)、減號 (-)、乘號 (*)、 除號 (div)、取餘數(mod)&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;字串(string)&lt;/span&gt;：XPath 不允許字串為了方便而用加號(+)串連在一起，字串的內文用兩個單引號或雙引號所包圍，儘管如此， concat(&lt;i&gt;string&lt;/i&gt;, &lt;i&gt;string&lt;/i&gt;, &lt;i&gt;string&lt;/i&gt;*) 還是滿足了連結字串的需求。&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;節點集(node set)&lt;/span&gt;：是來自一份 XML 文件中零或多個節點的集合。位置路徑(location path)通常會產生大多數的節點集。&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://libraclark.blogspot.com/feeds/3054877417768893752/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://libraclark.blogspot.com/2008/04/xpath-data-type.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3054877417768893752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23037558/posts/default/3054877417768893752'/><link rel='alternate' type='text/html' href='http://libraclark.blogspot.com/2008/04/xpath-data-type.html' title='XPath 資料類型(Data Type)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13507715338512832320</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>