<?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-7158527083456369396</id><updated>2024-11-06T11:10:06.876+08:00</updated><category term="C# .NET"/><category term="ASP.NET"/><category term="C/C++"/><category term="其他"/><category term="生活記事"/><category term="疑難雜症小技巧"/><category term="防毒"/><category term="MSN"/><category term="XML"/><category term="Blogger"/><category term="WPF"/><category term="ASCII"/><category term="CrystalReport"/><category term="DataGrid"/><category term="Label"/><category term="SQL"/><category term="SQL Server 2008"/><category term="SQL Server 2008 R2"/><category term="VS2010 Tool"/><category term="WMI"/><category term="WQL"/><category term="Xpath"/><category term="restore"/><category term="工具資源"/><category term="產生指令碼"/><category term="還原bak"/><category term="#endif"/><category term="#if"/><category term="ADO.NET"/><category term="Character \0"/><category term="CheckBox"/><category term="Chinese_Taiwan_Stroke_BIN2"/><category term="Chrome"/><category term="Columns"/><category term="Control"/><category term="Control Character"/><category term="DataBoundLiteralControl"/><category term="Docker"/><category term="EF"/><category term="EFTSQLDocumentation.Generator"/><category term="Element"/><category term="FindControl"/><category term="Gamma Correction"/><category term="GridView"/><category term="HTML"/><category term="Hexadecimal character"/><category term="Highlight"/><category term="Html Agility Pack"/><category term="Html Convert XML"/><category term="Html Parser"/><category term="Html2Xhtml"/><category term="IE"/><category term="IsUrlAvailable"/><category term="Java"/><category term="Kiss Radio"/><category term="KissRadio"/><category term="LavaLamp"/><category term="Linq"/><category term="MS_Description"/><category term="MarkupConverter"/><category term="MaxLength"/><category term="ModalPopupExtender"/><category term="MultiLine"/><category term="Mysql"/><category term="POODLE"/><category term="Plurk"/><category term="RegularExpression"/><category term="RegularExpressionValidator"/><category term="Repeater"/><category term="Rows"/><category term="SGMLReader"/><category term="SQL Server Collations"/><category term="SQL Syntax Highlighting"/><category term="SSL 3.0"/><category term="Security"/><category term="Synology"/><category term="TextArea"/><category term="TextBox"/><category term="TextMode"/><category term="Tidy"/><category term="TimeZone"/><category term="WMI Explorer"/><category term="Win32_NetworkAdapter"/><category term="XML Editor"/><category term="XMLQuire"/><category term="XPath Editor"/><category term="alignment"/><category term="char(0)"/><category term="colspan"/><category term="debug"/><category term="dropbox"/><category term="edmx"/><category term="hash"/><category term="html解析"/><category term="jQuery"/><category term="javascript"/><category term="linux"/><category term="listbox"/><category term="listitem"/><category term="md5"/><category term="network adapter"/><category term="password"/><category term="plugin"/><category term="postback"/><category term="rowspan"/><category term="salt"/><category term="syntaxhighlighter"/><category term="xp"/><category term="xpath tool"/><category term="全形"/><category term="半形"/><category term="巢狀"/><category term="新注音"/><category term="登錄檔"/><category term="跨資料行"/><category term="軟體分享"/><category term="遞迴"/><title type='text'>YC&#39;s knowledge Management</title><subtitle type='html'>答案永遠比問題多</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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>85</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-1066928237019381816</id><published>2024-01-27T12:21:00.006+08:00</published><updated>2024-01-27T12:25:45.581+08:00</updated><title type='text'>Visual Studio 2022 使用32位元的 IIS Express </title><content type='html'>當 Visual Studio 2022 預設使用 64 位元的 IIS Express 時，但您需要使用 32 位元函式庫，您可以通過修改 Visual Studio 的設定來切換至 32 位元版本的 IIS Express。&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;以下是該操作的步驟描述：&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;打開 Visual Studio。&amp;nbsp;&lt;/li&gt;&lt;li&gt;在選單欄中，點擊「工具」(Tools) 選項。&lt;/li&gt;&lt;li&gt;在下拉式選單中，選擇「選項」(Options)。&amp;nbsp;&lt;/li&gt;&lt;li&gt;在「選項」視窗中，尋找並展開「專案和解決方案」(Projects and Solutions) 部分。&amp;nbsp;&lt;/li&gt;&lt;li&gt;在「專案和解決方案」下，選擇「Web 專案」(Web Projects)。&lt;/li&gt;&lt;li&gt;在「Web 專案」設定中，您會看到一個選項叫做「使用 IIS Express 的 64 位元版本來執行網站和專案」(Use the 64 bit version of IIS Express for web sites and projects)。請取消勾選這個選項。&amp;nbsp;&lt;/li&gt;&lt;li&gt;點擊「確定」來保存更改。

這樣您就設定了 Visual Studio 使用 32 位元的 IIS Express。&lt;/li&gt;&lt;/ul&gt;這對於需要用到特定 32 位元函式庫的情況非常有用。&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://i.imgur.com/KnZG6Zd.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;474&quot; data-original-width=&quot;800&quot; height=&quot;389&quot; src=&quot;https://i.imgur.com/KnZG6Zd.jpeg&quot; width=&quot;656&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;參考：&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://superuser.com/questions/1204983/how-do-i-run-iis-express-from-the-command-line-with-enabled-32-bit-applications &quot; target=&quot;_blank&quot;&gt;https://superuser.com/questions/1204983/how-do-i-run-iis-express-from-the-command-line-with-enabled-32-bit-applications&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://blog.darkthread.net/blog/vs-iisexpress-bitness/ &quot; target=&quot;_blank&quot;&gt;https://blog.darkthread.net/blog/vs-iisexpress-bitness/&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://jumping-fun.blogspot.com/2017/02/iis-express-64-bit.html&quot; target=&quot;_blank&quot;&gt;https://jumping-fun.blogspot.com/2017/02/iis-express-64-bit.html&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/1066928237019381816/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2024/01/visual-studio-2022-32-iis-express.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/1066928237019381816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/1066928237019381816'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2024/01/visual-studio-2022-32-iis-express.html' title='Visual Studio 2022 使用32位元的 IIS Express '/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-3770535849064825416</id><published>2016-02-14T21:32:00.001+08:00</published><updated>2016-02-14T22:06:25.812+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Docker"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Synology"/><category scheme="http://www.blogger.com/atom/ns#" term="TimeZone"/><title type='text'>[Synology][Docker] 設定時區</title><content type='html'>Docker設定時區的方式有幾個方式，&lt;br /&gt;
&lt;br /&gt;
參考網路上的兩種做法&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
option 1: -v /etc/localtime:/etc/localtime:ro&lt;br /&gt;
option 2: -e &quot;TZ=Asia/Shanghai&quot;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;設定之前先看一下若沒有進行設定的話，會如下圖所示為格林威治時間&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBTISGuoPmgxB8sXJPI3MH0tHTzvG2udyWQBL7VZQdeMCes38OztFgwHeGTRdbTwIkDY9-UMlp7angYdMLFHOmZB45Y4139o3mHpz3RpemmzNPQMLMdEmfEah_on4UsZbDojY2VOpXMENv/s1600/docker_UTC.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBTISGuoPmgxB8sXJPI3MH0tHTzvG2udyWQBL7VZQdeMCes38OztFgwHeGTRdbTwIkDY9-UMlp7angYdMLFHOmZB45Y4139o3mHpz3RpemmzNPQMLMdEmfEah_on4UsZbDojY2VOpXMENv/s640/docker_UTC.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
1.設定容器&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9N4mL1IZlN4brYAqMs9uS8sKj0kQG1AH1XVtT4fA0KAmxllSrJQTjGWNTBrIbb68kQ-QCt30RK3X21Y7QMrH5PaY2q30c4uEwH3egfXJ29jEtdbqHqO0YtsANgEY_hEjK_ssqvihPmz7I/s1600/docker_newcontainer.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;460&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9N4mL1IZlN4brYAqMs9uS8sKj0kQG1AH1XVtT4fA0KAmxllSrJQTjGWNTBrIbb68kQ-QCt30RK3X21Y7QMrH5PaY2q30c4uEwH3egfXJ29jEtdbqHqO0YtsANgEY_hEjK_ssqvihPmz7I/s640/docker_newcontainer.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
2.進階設定&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd1BM-9ViQ-3QoFmRSQBHBwcHAmACwWqgjDcMgFNZ7s2VMHm-yM0AAQ5TJHStEtn7RTCWT0sJabfTBshuwHBfsMwcX93lb21ax5mpElwX5s0AjoAVt5hmk1ODG4is2jENC9CBQ3C2vQ1Nx/s1600/docker_Setting1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;460&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd1BM-9ViQ-3QoFmRSQBHBwcHAmACwWqgjDcMgFNZ7s2VMHm-yM0AAQ5TJHStEtn7RTCWT0sJabfTBshuwHBfsMwcX93lb21ax5mpElwX5s0AjoAVt5hmk1ODG4is2jENC9CBQ3C2vQ1Nx/s640/docker_Setting1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
3.設定環境變數，TZ=Asiz/Taipei&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAFT6YgTONGBDpFMo88W7mdJYAMP4JCy-HGPd8S-XbxQc5BYPirryDgNxPFygDljQC1Zlh648__9DGXRHUtoTQDfF4SlfdLbQBjAmbh0O4KRgMozPtj_k_Q2N7BjpJefHnpdeLA3qVD6fG/s1600/docker_Env.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;546&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAFT6YgTONGBDpFMo88W7mdJYAMP4JCy-HGPd8S-XbxQc5BYPirryDgNxPFygDljQC1Zlh648__9DGXRHUtoTQDfF4SlfdLbQBjAmbh0O4KRgMozPtj_k_Q2N7BjpJefHnpdeLA3qVD6fG/s640/docker_Env.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
4.確認日期和location時區一致&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/AVvXsEgVkauv_sO5UA6-GLJ7ZhxbLVrvnJVeHEP4UxO7JcmP-d70lwGGFACiLgpyKdUeqbD847F5VvYIJX_XJF-hebI3l3x-xOZjJzVaDe6rEHOFQRQdE5Iz8Dkfj1tZAQSRBJYnkcw-oZaEM5i2/s1600/docker_CST.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;123&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVkauv_sO5UA6-GLJ7ZhxbLVrvnJVeHEP4UxO7JcmP-d70lwGGFACiLgpyKdUeqbD847F5VvYIJX_XJF-hebI3l3x-xOZjJzVaDe6rEHOFQRQdE5Iz8Dkfj1tZAQSRBJYnkcw-oZaEM5i2/s640/docker_CST.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
參考出處：&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/22800624/will-docker-container-auto-sync-time-with-the-host-machine&quot;&gt;http://stackoverflow.com/questions/22800624/will-docker-container-auto-sync-time-with-the-host-machine&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/3770535849064825416/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2016/02/Synology-Docker-Set-Time-Zone.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3770535849064825416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3770535849064825416'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2016/02/Synology-Docker-Set-Time-Zone.html' title='[Synology][Docker] 設定時區'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEjBTISGuoPmgxB8sXJPI3MH0tHTzvG2udyWQBL7VZQdeMCes38OztFgwHeGTRdbTwIkDY9-UMlp7angYdMLFHOmZB45Y4139o3mHpz3RpemmzNPQMLMdEmfEah_on4UsZbDojY2VOpXMENv/s72-c/docker_UTC.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-2382731250145056540</id><published>2014-10-25T14:35:00.000+08:00</published><updated>2014-10-25T15:21:13.019+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chrome"/><category scheme="http://www.blogger.com/atom/ns#" term="IE"/><category scheme="http://www.blogger.com/atom/ns#" term="POODLE"/><category scheme="http://www.blogger.com/atom/ns#" term="Security"/><category scheme="http://www.blogger.com/atom/ns#" term="SSL 3.0"/><title type='text'>[Security] - 如何關閉瀏覽器SSL 3.0的安全協定?</title><content type='html'>SSL 3.0是一個安全協定，為網路傳輸過程做加密，以保護資料傳輸過程中不被外力竊取。&lt;br /&gt;
&lt;br /&gt;
不過在2014/10的一份報導(&lt;a href=&quot;http://www.ithome.com.tw/news/91571&quot; target=&quot;_blank&quot;&gt;Google 發現 SSL 3.0 漏洞，小心「貴賓犬」攻擊！&lt;/a&gt;)指出這個安全協定已不安全&lt;br /&gt;
&lt;br /&gt;
自救方法其實很簡單，只要將我們常用的瀏覽器工具，將SSL 3.0關閉，就能防範這個漏洞&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
首先，先透過以下的網址來確認自己的瀏覽器是否安全&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://zmap.io/sslv3/&quot;&gt;https://zmap.io/sslv3/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
倘若看到的是以下的畫面，可以嘗試操作對應的瀏覽器設定方式進行防範&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/AVvXsEiTI2hTTlo5qpP-XXSy2nkh0I9S7LTqNqttac2oGiy5bwaXhEKlecSKKqxry09qK-zv9GCbTQzA4zwO-R_HZIEJdTAA8a0PeQtDNBlKMnD_-N1o7u5YqqQtYcdHI6lB-YLQ1IvrBm6z163F/s1600/Error.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTI2hTTlo5qpP-XXSy2nkh0I9S7LTqNqttac2oGiy5bwaXhEKlecSKKqxry09qK-zv9GCbTQzA4zwO-R_HZIEJdTAA8a0PeQtDNBlKMnD_-N1o7u5YqqQtYcdHI6lB-YLQ1IvrBm6z163F/s1600/Error.png&quot; height=&quot;163&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
介紹常用的幾款瀏覽器如何關閉。&lt;br /&gt;
&lt;br /&gt;
一、Google Chrome：&lt;br /&gt;
　　在捷徑上加入–ssl-version-min=tls1參數，步驟如下：&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/AVvXsEgzo5kPUOzmm2QO6kk2ausqrdi_u-JLefppxSA72UYq5Z2uQbaeZXSXZoe6YkAf5H9qZ69DjyWsZ5-IDAqNAwQbpsTkoBbz8bLabNdn2ybS2oIH8OPKlsYt64CvtLgQ87mb2NHKN5LNUZFn/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzo5kPUOzmm2QO6kk2ausqrdi_u-JLefppxSA72UYq5Z2uQbaeZXSXZoe6YkAf5H9qZ69DjyWsZ5-IDAqNAwQbpsTkoBbz8bLabNdn2ybS2oIH8OPKlsYt64CvtLgQ87mb2NHKN5LNUZFn/s1600/1.png&quot; /&gt;&lt;/a&gt;&lt;/div&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/AVvXsEi2XDggwt7LGvmenpdQPT3Pal9Z3z0r-_Jdv5Gd4MEVHcTWLnkF_BcMFon4OqVGDH9sGYvMYS_V8sK_xnsAuAzdfaYYrCFTghJeS57yN_7dAZCJPiWP2vdpZauMObppKPdBEem6Wv8iw1Aw/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2XDggwt7LGvmenpdQPT3Pal9Z3z0r-_Jdv5Gd4MEVHcTWLnkF_BcMFon4OqVGDH9sGYvMYS_V8sK_xnsAuAzdfaYYrCFTghJeS57yN_7dAZCJPiWP2vdpZauMObppKPdBEem6Wv8iw1Aw/s1600/2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
　　設定好之後，將Chrome全部關掉重新啟動就成功了。&lt;/div&gt;
P.S.若仍無效果請重新開機&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
二、IE&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
　　透過網際網路選項把SSL3.0勾掉，結果如下圖：&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
　　&lt;/div&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/AVvXsEjMek5csyBYUJRJWkF1VEsUVxUn1vDR6t6jjJZEfEaFVeVCFB_LTUZbHxK4tXiZ4vAuSsVbXNCx7T9Z1StF6j4HooTActvNvc9ay48ekxcLewl6i2agd4XvNzEs9eCi4-mIv0cjnBy5GfaG/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMek5csyBYUJRJWkF1VEsUVxUn1vDR6t6jjJZEfEaFVeVCFB_LTUZbHxK4tXiZ4vAuSsVbXNCx7T9Z1StF6j4HooTActvNvc9ay48ekxcLewl6i2agd4XvNzEs9eCi4-mIv0cjnBy5GfaG/s1600/3.png&quot; height=&quot;400&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
作完設定動作之後，再用&lt;a href=&quot;https://zmap.io/sslv3/&quot;&gt;https://zmap.io/sslv3/&lt;/a&gt;來撿測一次，就能如下方圖示囉！&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8i965dMJFn-r7LdpcVEGxI5wW9fLvGST-cLctyH0puynljSHZ1GbMithXAwUFNKpsg5lgaVtJ_aQmfSR3U5qQ_sIL2EcxlleRwmAOghbY2o1ticy0J59HEA4eBA8XiNs04xOy2joRsBG-/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8i965dMJFn-r7LdpcVEGxI5wW9fLvGST-cLctyH0puynljSHZ1GbMithXAwUFNKpsg5lgaVtJ_aQmfSR3U5qQ_sIL2EcxlleRwmAOghbY2o1ticy0J59HEA4eBA8XiNs04xOy2joRsBG-/s1600/4.png&quot; height=&quot;151&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
其他的瀏覽器修改方式，請參閱參考出處。&lt;br /&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
1.&lt;a href=&quot;http://www.ithome.com.tw/news/91571&quot;&gt;http://www.ithome.com.tw/news/91571&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;https://www.digicert.com/ssl-support/disabling-browser-support-ssl-v3.htm&quot;&gt;https://www.digicert.com/ssl-support/disabling-browser-support-ssl-v3.htm&lt;/a&gt;&lt;br /&gt;
3.&lt;a href=&quot;http://ssorc.tw/5014&quot;&gt;http://ssorc.tw/5014&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
P.S.轉載請附上原文連結。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/2382731250145056540/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2014/10/disabling-browser-support-for-ssl-30.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2382731250145056540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2382731250145056540'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2014/10/disabling-browser-support-for-ssl-30.html' title='[Security] - 如何關閉瀏覽器SSL 3.0的安全協定?'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEiTI2hTTlo5qpP-XXSy2nkh0I9S7LTqNqttac2oGiy5bwaXhEKlecSKKqxry09qK-zv9GCbTQzA4zwO-R_HZIEJdTAA8a0PeQtDNBlKMnD_-N1o7u5YqqQtYcdHI6lB-YLQ1IvrBm6z163F/s72-c/Error.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-5657264636251741888</id><published>2014-03-13T22:51:00.002+08:00</published><updated>2014-03-13T23:59:48.026+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="hash"/><category scheme="http://www.blogger.com/atom/ns#" term="md5"/><category scheme="http://www.blogger.com/atom/ns#" term="password"/><category scheme="http://www.blogger.com/atom/ns#" term="salt"/><title type='text'>[C#]密碼加「鹽」了嗎？</title><content type='html'>今天要來聊聊密碼的安全性，既然是密碼就應該有高度的安全性，只有使用者自己知道而已&lt;br /&gt;
&lt;br /&gt;
密碼存在資料中通常用三種方式存在&lt;br /&gt;
一、明碼：這應該是沒人敢做吧？&lt;br /&gt;
二、可逆密碼：僅限於必須要還原密碼的情境，若無需還原建議選第三方案！&lt;br /&gt;
三、不可逆密碼：應該大多數人都選用這種方案吧！&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;主要要探討的是第二、三種方式，第二與第三種方式在被Hacker取走之後，&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;可逆密碼：可用暴力破解法慢慢的破，破解之日指日可待。&lt;/li&gt;
&lt;li&gt;不可逆密碼：可用HashTable比對來擊破&lt;/li&gt;
&lt;/ul&gt;
看到這裡會想說....天啊....那還有什麼是安全的?&lt;br /&gt;
&lt;br /&gt;
其實&quot;沒有&quot;，緩兵之計是增加Hacker的成本，也就是增加破解的時間，&lt;br /&gt;
讓管理者有時間發現與通知使用者換密碼&lt;br /&gt;
&lt;br /&gt;
至於要怎麼加強密碼強度呢？&lt;br /&gt;
可以採用加Salt的方式，加入Salt，這是什麼意思？&lt;br /&gt;
意思就是在加密之前，先對密碼做一次手腳&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
密碼－＞加Salt－＞加密&amp;nbsp;&lt;/blockquote&gt;
而.net本身有提供這種加Salt的類別Rfc2898DeriveBytes，&lt;br /&gt;
方法如下：&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;        /// &lt;summary&gt;
        /// 使用依據 HMACSHA1 使用虛擬亂數產生器，實作密碼式的金鑰衍生功能 PBKDF2。
        /// &lt;/summary&gt;
        private string GenRfc(string Password,int KeySize)
        { 
            //加鹽，加入(控八控控-控控控-控控控)
            byte[] salt = new byte[] { 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
            byte[] key = Encoding.UTF8.GetBytes(Password);
            Rfc2898DeriveBytes rfcKey = new Rfc2898DeriveBytes(key, salt, 2);
            return rfcKey.GetBytes(KeySize);
        }
&lt;/pre&gt;
&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/AVvXsEiKYoc1BLYaiq7Rya5ucM3CVD6DBAJCvW_xGzokX_xcKy22mbiA3bNj0tsrDA0-n2K9TRKu1ujzUQUd0cubWHn1PM_P8AyExVGfjayk9VuKam1BPShKEYrapWyfEJICYjDJirRH3CIOLP00/s1600/salt.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKYoc1BLYaiq7Rya5ucM3CVD6DBAJCvW_xGzokX_xcKy22mbiA3bNj0tsrDA0-n2K9TRKu1ujzUQUd0cubWHn1PM_P8AyExVGfjayk9VuKam1BPShKEYrapWyfEJICYjDJirRH3CIOLP00/s1600/salt.png&quot; height=&quot;91&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
除了能增加密碼複雜度，也能符合需要特定長度的對稱式加密演算法。&lt;br /&gt;
&lt;br /&gt;
經過加密的密碼，即使是用hashTable也對不出真正的密碼其實是123456789.&lt;br /&gt;
&lt;br /&gt;
獻給需要吃重鹹的使用者。&lt;br /&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
1.&lt;a href=&quot;http://www.dotblogs.com.tw/yc421206/archive/2012/04/18/71609.aspx&quot; id=&quot;viewpost_ascx_TitleUrl&quot; style=&quot;border-style: none; font-family: 細明體, Arial, Helvetica, sans-serif; font-size: 13px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;[C#.NET] 字串及檔案 利用 DES / AES 演算法加解密&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://blogs.technet.com/b/twsecurity/archive/2014/02/10/3622519.aspx&quot; target=&quot;_blank&quot;&gt;密碼儲存要加”鹽”才夠安全&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
P.S.轉載請附上原文連結&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/5657264636251741888/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2014/03/using-net-salting-your-password.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/5657264636251741888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/5657264636251741888'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2014/03/using-net-salting-your-password.html' title='[C#]密碼加「鹽」了嗎？'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEiKYoc1BLYaiq7Rya5ucM3CVD6DBAJCvW_xGzokX_xcKy22mbiA3bNj0tsrDA0-n2K9TRKu1ujzUQUd0cubWHn1PM_P8AyExVGfjayk9VuKam1BPShKEYrapWyfEJICYjDJirRH3CIOLP00/s72-c/salt.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-123368190000574894</id><published>2014-02-25T02:02:00.001+08:00</published><updated>2014-06-21T10:10:08.495+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASCII"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Control Character"/><category scheme="http://www.blogger.com/atom/ns#" term="Hexadecimal character"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>[XML][C#]XML遇到ASCII控制字元處理方法</title><content type='html'>最近遇到了一個頗妙的狀況，原先的目的是要將資料轉成XML格式，&lt;br /&gt;
輸出後檢測卻發現了一個元素所填入的資料含有特殊字元&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/AVvXsEjWZodU0dpEUzzJ2oSWFztnJS1gOBxRVlrWPW-dYasxvwBZDGAlGLkrkzBQt4-pZlaW4HJsP0CJkuStu6iN-s7_wSBDxSkhH-rIYR08m3qFGBL0J2QYwE-x3xinfgdXs0W9kPBOMJW4PvCj/s1600/XML_Control_Char.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWZodU0dpEUzzJ2oSWFztnJS1gOBxRVlrWPW-dYasxvwBZDGAlGLkrkzBQt4-pZlaW4HJsP0CJkuStu6iN-s7_wSBDxSkhH-rIYR08m3qFGBL0J2QYwE-x3xinfgdXs0W9kPBOMJW4PvCj/s1600/XML_Control_Char.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
既然已知是特殊字元，那就是把它取代掉就沒事了。&lt;br /&gt;
&lt;br /&gt;
可是...是哪些特殊字元不能用?拜神之後得到一些可能的答案&lt;br /&gt;
&lt;br /&gt;
原來是ASCII碼中 00H 到 1FH字元是控制字元，所以XML在讀取時會出現錯誤&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://home.educities.edu.tw/wanker742126/asm/ascii_t1.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://home.educities.edu.tw/wanker742126/asm/ascii_t1.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
(出處:&lt;a href=&quot;http://home.educities.edu.tw/wanker742126/asm/ap04.html&quot;&gt;http://home.educities.edu.tw/wanker742126/asm/ap04.html&lt;/a&gt;)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;text-align: start;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;text-align: start;&quot;&gt;詳情請見&lt;/span&gt;&lt;a href=&quot;http://www.w3.org/TR/WD-xml-961114#sec1.5&quot; style=&quot;text-align: start;&quot; target=&quot;_blank&quot;&gt;W3C定義&lt;/a&gt;查閱&lt;/div&gt;
&lt;br /&gt;
既然找到哪些字元了，那就可以寫一段方法專門處理這種字串。&lt;br /&gt;
參考網路上找到的寫法如下：&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;public static class YCExtension
{
    /// &lt;summary&gt;
    /// Removes control characters and other non-UTF-8 characters
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;inString&quot; /&gt;The string to process
    /// &lt;returns&gt;A string with no control characters or entities above 0x00FD&lt;/returns&gt;
    public static string RemoveTroublesomeCharacters(this string inString)
    {
        if (inString == null) return null;

        StringBuilder newString = new StringBuilder();
        char ch;

        for (int i = 0; i &amp;lt; inString.Length; i++)
        {

            ch = inString[i];
            // remove any characters outside the valid UTF-8 range as well as all control characters
            // except tabs and new lines
            if ((ch &amp;lt; 0x00FD &amp;amp;&amp;amp; ch &amp;gt; 0x001F) || ch == &#39;\t&#39; || ch == &#39;\n&#39; || ch == &#39;\r&#39;)
            {
                newString.Append(ch);
            }
        }
        return newString.ToString();

    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/20762/how-do-you-remove-invalid-hexadecimal-characters-from-an-xml-based-data-source-p&quot;&gt;http://stackoverflow.com/questions/20762/how-do-you-remove-invalid-hexadecimal-characters-from-an-xml-based-data-source-p&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://home.educities.edu.tw/wanker742126/asm/ap04.html&quot;&gt;http://home.educities.edu.tw/wanker742126/asm/ap04.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------------------------------------&lt;br /&gt;
2014/06/21補充:&lt;br /&gt;
最近又遇到，重新查了一次資料，找到了Linq的寫法，簡明扼要，一行搞定！！！&lt;br /&gt;
語法如下&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;string s=&quot;含有控制字元內容&quot;;
s =new string(s.Where(p =&amp;gt; !char.IsControl(p)).Select(p=&amp;gt;p).ToArray());
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/123368190000574894/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2014/02/remove-xml-invalid-hexadecimalcharacters.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/123368190000574894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/123368190000574894'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2014/02/remove-xml-invalid-hexadecimalcharacters.html' title='[XML][C#]XML遇到ASCII控制字元處理方法'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEjWZodU0dpEUzzJ2oSWFztnJS1gOBxRVlrWPW-dYasxvwBZDGAlGLkrkzBQt4-pZlaW4HJsP0CJkuStu6iN-s7_wSBDxSkhH-rIYR08m3qFGBL0J2QYwE-x3xinfgdXs0W9kPBOMJW4PvCj/s72-c/XML_Control_Char.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-8589840520371214339</id><published>2013-05-28T22:55:00.002+08:00</published><updated>2013-05-28T23:51:31.336+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="char(0)"/><category scheme="http://www.blogger.com/atom/ns#" term="Character \0"/><category scheme="http://www.blogger.com/atom/ns#" term="Chinese_Taiwan_Stroke_BIN2"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Collations"/><title type='text'>[SQL] - Char(0)問題處理</title><content type='html'>最近在處理問題時遇到一個很玄的問題....欄位中含有Char(0)的特殊字元，&lt;br /&gt;
範例圖如下：左圖使用文字模式顯示，右圖使用表格方式顯示&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiykSH-9vvuBrrYDtXYqqhqhjesUXr1WFw4KL8wiilZ2FGN79MXsgMReI2wTvfPHkNs1vTXP7ok3YkanXBRJ3LMVfgRgCpG5iGw58eoeITuhdQai4fFr2vEgucAFpgw9pvSPdbcLOdhDTgQ/s1600/Char0%E5%95%8F%E9%A1%8C1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiykSH-9vvuBrrYDtXYqqhqhjesUXr1WFw4KL8wiilZ2FGN79MXsgMReI2wTvfPHkNs1vTXP7ok3YkanXBRJ3LMVfgRgCpG5iGw58eoeITuhdQai4fFr2vEgucAFpgw9pvSPdbcLOdhDTgQ/s640/Char0%E5%95%8F%E9%A1%8C1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
這樣子的資料在網頁或者程式顯示的狀況下可能會出現錯誤，
&lt;br /&gt;
那要如何去修正這個問題呢？&lt;br /&gt;
有兩個方案如下：&lt;br /&gt;
1.參考&lt;a href=&quot;http://stackoverflow.com/questions/3533320/sql-server-remove-end-string-character-0-from-data&quot;&gt;Sql Server - Remove End String Character “\0” From Data&lt;/a&gt;
&lt;br /&gt;
建立如下SQL Function，原理是將非UNICODE排除掉。
&lt;br /&gt;
&lt;pre class=&quot;brush: sql;&quot;&gt;
CREATE FUNCTION dbo.RemoveNullChars 
(
    @string NVARCHAR(MAX)
)
RETURNS NVARCHAR(MAX) WITH RETURNS NULL ON NULL INPUT
AS
BEGIN
DECLARE @Result NVARCHAR(MAX)
SET @Result = &#39;&#39;

DECLARE @counter INT

SET @counter = 0

WHILE (@counter &lt;= LEN(@string))
    BEGIN
     IF UNICODE(SUBSTRING(@string,@counter,1)) &lt;&gt;  0 
        SET @Result = @Result + SUBSTRING(@string,@counter,1)
    SET @counter = @counter + 1    
    END
RETURN @Result
END
&lt;/pre&gt;&lt;br /&gt;
實際運用方式如下：
&lt;pre class=&quot;brush: sql;&quot;&gt;
UPDATE #table SET Title= dbo.RemoveNullChars (Title)
&lt;/pre&gt;
&lt;br /&gt;
2.使用SQL 定序的方式處理(這是經過大師指點的)&lt;a href=&quot;http://sqlserverlearner.com/sql-server-link/sql-server-collations&quot;&gt;SQL Server Collations&lt;/a&gt;
&lt;br /&gt;
將char(0)使用定序的方法轉成binary code，再去做Replace
&lt;br /&gt;
&lt;pre class=&quot;brush: sql;&quot;&gt;
select REPLACE(Title COLLATE Chinese_Taiwan_Stroke_BIN2,CHAR(0),N&#39; &#39;) from #table
&lt;/pre&gt;
&lt;br /&gt;

這樣子就能將資料庫中有問題的資料做更新囉!
&lt;br /&gt;
&lt;br /&gt;

參考出處：&lt;br /&gt;
1.&lt;a href=&quot;http://stackoverflow.com/questions/3533320/sql-server-remove-end-string-character-0-from-data&quot;&gt;Sql Server - Remove End String Character “\0” From Data&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://sqlserverlearner.com/sql-server-link/sql-server-collations&quot;&gt;SQL Server Collations&lt;/a&gt;&lt;br /&gt;
3.&lt;a href=&quot;http://www.dotblogs.com.tw/jimmyyu/archive/2009/08/30/10320.aspx&quot;&gt;談談SQL Server的定序(Collation)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;

後記：幾經思考，為何SQL對這個Char(0)字元會有如此的反應，聯想到以前大學學習C語言時，字元陣列的最後一個字元需為&#39;\0&#39;，或許是因為程式抓到了結束字元，剩下的通通丟掉拿去做雞精了吧.....</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/8589840520371214339/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2013/05/sql-char0.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8589840520371214339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8589840520371214339'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2013/05/sql-char0.html' title='[SQL] - Char(0)問題處理'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEiykSH-9vvuBrrYDtXYqqhqhjesUXr1WFw4KL8wiilZ2FGN79MXsgMReI2wTvfPHkNs1vTXP7ok3YkanXBRJ3LMVfgRgCpG5iGw58eoeITuhdQai4fFr2vEgucAFpgw9pvSPdbcLOdhDTgQ/s72-c/Char0%E5%95%8F%E9%A1%8C1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-8214243984964412939</id><published>2013-05-01T23:56:00.001+08:00</published><updated>2013-05-01T23:59:00.491+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Control"/><category scheme="http://www.blogger.com/atom/ns#" term="FindControl"/><category scheme="http://www.blogger.com/atom/ns#" term="遞迴"/><title type='text'>[Asp.net] - FindControl找不到想要的Control?</title><content type='html'>當Asp.net混雜著UpdatePanel、TabPanel....容器時，控制項在編譯期都會被加上一段物件名稱，&lt;br&gt;&lt;br&gt;

但使用FindControl卻是要一層一層的去找找找....如下行範例.....&lt;br&gt;&lt;br&gt;

&lt;pre class=&quot;brush: csharp;&quot;&gt;
Control c=Page.FindControl(&quot;TabPanel1&quot;).FindPanel(&quot;tab_02&quot;).FindPanel(&quot;txtTest&quot;);
&lt;/pre&gt;&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: csharp;&quot;&gt;
        public static T FindControl&lt;T&gt;(Control startingControl, string id) where T : Control
        {
            
            // 取得 T 的預設值，通常是 null
            T found = default(T);

            if (startingControl.Controls.Count &gt; 0)
            {
                foreach (Control activeControl in startingControl.Controls)
                {
                    if (activeControl is T)
                    {
                        found = activeControl as T;
                        if (string.Compare(id, found.ID, true) == 0) break;
                        else found = null;
                    }
                    else
                    {
                        found = FindControl&lt;T&gt;(activeControl, id);
                        if (found != null) break;
                    }
                }
            }
            return found;
        }
&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;

最後show一下使用方式：
&lt;pre class=&quot;brush: csharp;&quot;&gt;
Control c = FindControl&lt;ＴextBox&gt;(this.Page, &quot;txtTest&quot;);
&lt;/pre&gt;
是不是清爽多了！！！！&lt;br&gt;

優點：前端aspx異動也不怕要異動程式碼&lt;br&gt;

光這一點就可以省下許多時間去茶水間泡杯咖啡囉~&lt;br&gt;&lt;br&gt;

參考出處：&lt;br&gt;
1.&lt;a href=&quot;http://blog.miniasp.com/post/2007/11/04/ASPNET-FindControl-Tips-and-Hacks.aspx&quot;&gt;你有用 FindControl 時找不到 Control (控制項) 的經驗嗎&lt;/a&gt;&lt;br&gt;
2.&lt;a href=&quot;http://blogs.interfacett.com/category/developer-visual-studio-asp-net&quot;&gt;程式碼出處&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/8214243984964412939/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2013/05/use-recursion-find-control.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8214243984964412939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8214243984964412939'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2013/05/use-recursion-find-control.html' title='[Asp.net] - FindControl找不到想要的Control?'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-4054682936721536638</id><published>2012-08-28T01:24:00.003+08:00</published><updated>2012-08-28T02:30:57.060+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="edmx"/><category scheme="http://www.blogger.com/atom/ns#" term="EF"/><category scheme="http://www.blogger.com/atom/ns#" term="EFTSQLDocumentation.Generator"/><category scheme="http://www.blogger.com/atom/ns#" term="Linq"/><category scheme="http://www.blogger.com/atom/ns#" term="MS_Description"/><title type='text'>[C#][EF] - EF轉換中繼資料加入SQL MS_Description</title><content type='html'>LINQ這個技術已經很久了!但遲遲未開始學習的腳步，既然要學就找了一個最近很夯的LINQ to&amp;nbsp;&amp;nbsp;Entity Framework&amp;nbsp;來練習。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
在練習LINQ to&amp;nbsp;&amp;nbsp;Entity Framework 使用&quot;ADO.NET實體資料模型&quot;產生SQL的中繼檔案時，發現了一個問題。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&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/AVvXsEiythTrmkXVEfVHczJoFuE-y_rBqQ_qvY2yVG1c237Fwk1WeuKjGH6ejThK5WDX6NeYPmM46_Y6qBRrR5CcyusC6dGQsBMv1gJbgPWMtggPV-3BAWXUYEyUALGyh-6RDI_rV35caHsmyw48/s1600/Linq.designer.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;152&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiythTrmkXVEfVHczJoFuE-y_rBqQ_qvY2yVG1c237Fwk1WeuKjGH6ejThK5WDX6NeYPmM46_Y6qBRrR5CcyusC6dGQsBMv1gJbgPWMtggPV-3BAWXUYEyUALGyh-6RDI_rV35caHsmyw48/s640/Linq.designer.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
一開始以為是自己沒有作對設定，上網找了許久皆無良策，&lt;br /&gt;
&lt;br /&gt;
轉而提問，得到的回覆是可能轉換工具中尚無支援這種設定的功能，&lt;br /&gt;
&lt;br /&gt;
不過人就是背骨，不信邪繼續找，終於找到了一個第三方工具&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://eftsqldocgenerator.codeplex.com/releases/view/69447&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;border: 0px; color: #2e8bcc; font-family: &#39;Segoe UI Light&#39;, &#39;Tahoma Light&#39;, &#39;Arial Light&#39;, &#39;Helvetica Light&#39;, sans-serif; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;Entity Framework SQL Server Document&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2e8bcc; font-family: Segoe UI Light, Tahoma Light, Arial Light, Helvetica Light, sans-serif;&quot;&gt;Generator&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
這個工具可以將SQL Server所設定好的資料表摘要及欄位摘要轉換成edmx&lt;br /&gt;
&lt;br /&gt;
接下來逐一介紹步驟(開始前請先下載好轉換的第三方工具)：&lt;br /&gt;
1.先透過&quot;ADO.NET實體資料模型&quot;產生edmx的中繼資料檔案，請參閱MSDN說明：&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/bb399739(v=vs.100)&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;產生 School .edmx 檔案 (Entity Framework 快速入門)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2.先將SQL Server中要做轉換的相關資料表及欄位摘要做好註解&lt;br /&gt;
(此次使用MSDN的&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/bb399731(v=vs.100)&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;School DB&lt;/a&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/AVvXsEiBwP6t17-fISYEQ7nPNl3Exwtmqci2FyQYXsy8MGdn55Hrgq7pqxamea56SwCMVCkOik5LlW6D-oV7LPDyEv_nVOrkRbFkdbgNTCxn3VBO7WHqJUmZ6rlY_SrL5eADhsAcjHwDSMd_j24D/s1600/EFTSQLDocumentation.Generator-0.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBwP6t17-fISYEQ7nPNl3Exwtmqci2FyQYXsy8MGdn55Hrgq7pqxamea56SwCMVCkOik5LlW6D-oV7LPDyEv_nVOrkRbFkdbgNTCxn3VBO7WHqJUmZ6rlY_SrL5eADhsAcjHwDSMd_j24D/s400/EFTSQLDocumentation.Generator-0.png&quot; width=&quot;390&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
3.使用EFTSQLDocumentation.Generator.exe進行轉換的工作&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/AVvXsEgXIz4_xL_dZ81ztVQc46YPkUMlGuHgWGp96faKw2NYqaTMdUKThCPZEt3GZAZtY5lF3YBnygtsNLyJ5NAzMHMI1nndqSN6-fGKbZdAR2am_Seg0FkNxguFNj0kbt0K-buQexx8G0BybhDk/s1600/EFTSQLDocumentation.Generator-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;104&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXIz4_xL_dZ81ztVQc46YPkUMlGuHgWGp96faKw2NYqaTMdUKThCPZEt3GZAZtY5lF3YBnygtsNLyJ5NAzMHMI1nndqSN6-fGKbZdAR2am_Seg0FkNxguFNj0kbt0K-buQexx8G0BybhDk/s640/EFTSQLDocumentation.Generator-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
參數說明：&lt;br /&gt;
-c：連線資訊&lt;br /&gt;
-i：輸入檔案edmx&lt;br /&gt;
-o：輸出檔案edmx(非必要參數)&lt;/blockquote&gt;
&amp;nbsp; &amp;nbsp;產生的結果如下：（會顯示出產生結果及一些資料）&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/AVvXsEjratwABOMs4HN4THxM3cUQCElbFSYZFewy4trSh87d1Ca55RrgxP1Ks9Po5ThOQlCwyoBUYHKpunckA98Tn4ETI7B4VSevJHmvAJU1IaA0R5vMqGrAC-dG4iCUrE7ecr9PIC5klnueElFI/s1600/EFTSQLDocumentation.Generator-2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;120&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjratwABOMs4HN4THxM3cUQCElbFSYZFewy4trSh87d1Ca55RrgxP1Ks9Po5ThOQlCwyoBUYHKpunckA98Tn4ETI7B4VSevJHmvAJU1IaA0R5vMqGrAC-dG4iCUrE7ecr9PIC5klnueElFI/s640/EFTSQLDocumentation.Generator-2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
4.接著最後一步將產生好的edmx檔案放回專案中，開啟如下的畫面，&lt;br /&gt;
按下右鍵選取&quot;從資料庫更新模型&quot;&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/AVvXsEhrnvFAoAmfczryla4qQgwLRvXJq6GK6A_eWbruDTPvfYI7WwLZLD2hLeycf1qXVYD-AdZkoFnSgJuQOWtkqEpozpcj-7eNhIvFr8FeY56iELqo0OlPtqiQDFfQofDGGuDvgO-lqwCPUlD3/s1600/UpdateSQLModel.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;160&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrnvFAoAmfczryla4qQgwLRvXJq6GK6A_eWbruDTPvfYI7WwLZLD2hLeycf1qXVYD-AdZkoFnSgJuQOWtkqEpozpcj-7eNhIvFr8FeY56iELqo0OlPtqiQDFfQofDGGuDvgO-lqwCPUlD3/s400/UpdateSQLModel.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
5.選取資料表及可能使用到的相關物件&lt;/div&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/AVvXsEhT6_mw1dPQAX05vBmYofsgKCDZcCVPw0YckWh26UVFSq6cOslI6o1082R9rJeUTyNbbweIZkO8U2UMt0s1bX-yOmZmBpN5q9gXD9doIYWyFOnUiQO20BIyUvHD9hKNzjq2KfY_p-isxjz9/s1600/UpdateSQLModel1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;345&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT6_mw1dPQAX05vBmYofsgKCDZcCVPw0YckWh26UVFSq6cOslI6o1082R9rJeUTyNbbweIZkO8U2UMt0s1bX-yOmZmBpN5q9gXD9doIYWyFOnUiQO20BIyUvHD9hKNzjq2KfY_p-isxjz9/s400/UpdateSQLModel1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
↓按下完成後會看到如下圖轉換結果。&lt;/div&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/AVvXsEjWJ3SPeJ3DMgwMHYMugzwHNwGoCd7Vx8AwSyuf9O_HSHE6cmIpAqPVW83Q8GiJrtEUXl_UGXokTH9fx325n5g1rkUOCnClkDFL1LxwCRBYnHBBn_Xp4b3WXOhfVO9oNN1QtvSjdaUGOwLT/s1600/UpdateSQLModel2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWJ3SPeJ3DMgwMHYMugzwHNwGoCd7Vx8AwSyuf9O_HSHE6cmIpAqPVW83Q8GiJrtEUXl_UGXokTH9fx325n5g1rkUOCnClkDFL1LxwCRBYnHBBn_Xp4b3WXOhfVO9oNN1QtvSjdaUGOwLT/s1600/UpdateSQLModel2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
6.享受其便利性，這樣子開發程式時可以清楚地馬上知道這個欄位是做什麼用途的，不必再回頭去找DB schema了。&lt;/div&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/AVvXsEjPRMDG6y1O770BwTxEsDsMC_5yR24A23Yen7n0dtiFPkScSzHeSEqE7qoIf-66fXQ19W4SeNZ2sN687uiEdZfg3Pz7FqIPQVN8T0fN3o-tJ3l4BFE1GtNPm7UxxiPo9uswHHehCygHcpC_/s1600/EFTSQLDocumentation.Generator-3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPRMDG6y1O770BwTxEsDsMC_5yR24A23Yen7n0dtiFPkScSzHeSEqE7qoIf-66fXQ19W4SeNZ2sN687uiEdZfg3Pz7FqIPQVN8T0fN3o-tJ3l4BFE1GtNPm7UxxiPo9uswHHehCygHcpC_/s400/EFTSQLDocumentation.Generator-3.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
參考出處：&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
1.&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/bb399182(v=vs.100)&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;快速入門 (Entity Framework)&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
2.&lt;a href=&quot;http://eftsqldocgenerator.codeplex.com/releases/view/69447&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Entity Framework SQL Server Document Generator&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
3.&lt;a href=&quot;http://www.dotblogs.com.tw/remhom/archive/2009/04/22/8120.aspx&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;自己製作線上查詢SQL Schema的功能&lt;/a&gt;&lt;/div&gt;

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/4054682936721536638/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/08/linq-to-ef-add-msdescription-into-edmx.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/4054682936721536638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/4054682936721536638'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/08/linq-to-ef-add-msdescription-into-edmx.html' title='[C#][EF] - EF轉換中繼資料加入SQL MS_Description'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEiythTrmkXVEfVHczJoFuE-y_rBqQ_qvY2yVG1c237Fwk1WeuKjGH6ejThK5WDX6NeYPmM46_Y6qBRrR5CcyusC6dGQsBMv1gJbgPWMtggPV-3BAWXUYEyUALGyh-6RDI_rV35caHsmyw48/s72-c/Linq.designer.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-3442955031692252950</id><published>2012-07-22T03:42:00.002+08:00</published><updated>2012-07-22T03:58:16.291+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="#endif"/><category scheme="http://www.blogger.com/atom/ns#" term="#if"/><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><title type='text'>[C#] - Debug模式運用</title><content type='html'>Debug是程式設計師必備的技能，在Debug之前可能會輸入許多的條件。&lt;br /&gt;
如：輸入框要輸入數值....等&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
如果像下面這樣加入測試資料，看似沒什麼！&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;textBox1.Text = &quot;100/01/01&quot;;//測試資料

string test = textBox1.Text;&lt;/pre&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
但當您忙碌時忘了把測試值拿掉，當使用者在使用時就會發現有異狀，又要再修正一次。&lt;br /&gt;
&lt;br /&gt;
如果是在做測試時，可以利用.net提供的Debug模式指令來填測試資料，如下一段程式碼。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;            textBox1.Text = &quot;&quot;;
                       
#if (debug)
            textBox1.Text = &quot;101/07/01&quot;;//測試資料
#endif
            string test = textBox1.Text;&lt;/pre&gt;
&lt;br /&gt;
這樣子就可以在Debug模式中，把測試值塞進去程式裡，當Release給使用者時，&lt;br /&gt;
&lt;br /&gt;
就不必擔心測試資料忘了刪掉，可以避免掉很多不必要的衍伸問題。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
&lt;a href=&quot;http://blog.miniasp.com/post/2009/09/16/How-to-utilize-Debug-mode-to-develop-aspnet-and-other-net-applications.aspx&quot; target=&quot;_blank&quot;&gt;如何善用「偵錯模式」進行 ASP.NET 網站或 .NET 程式開發&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/3442955031692252950/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/07/c-sharp-debug-mode.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3442955031692252950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3442955031692252950'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/07/c-sharp-debug-mode.html' title='[C#] - Debug模式運用'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-4178433919315988749</id><published>2012-07-04T20:51:00.002+08:00</published><updated>2012-07-04T21:26:04.163+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="restore"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 R2"/><category scheme="http://www.blogger.com/atom/ns#" term="產生指令碼"/><category scheme="http://www.blogger.com/atom/ns#" term="還原bak"/><title type='text'>[SQL] - SQL Server 2008 R2 還原 SQL Server 2008 - PartII</title><content type='html'>繼上一篇&lt;a href=&quot;http://yanchi-huang.blogspot.tw/2012/06/sqlserver-2008-r2-restore-to-2008.html&quot; target=&quot;_blank&quot;&gt;[SQL] - SQL Server 2008 R2 還原 SQL Server 2008 - PartI&lt;/a&gt;&amp;nbsp;產出了大量的insert指令&lt;br /&gt;
&lt;br /&gt;
心想直接貼上查詢視窗按下執行就可以去做其他事情等結果了....&lt;br /&gt;
&lt;br /&gt;
沒想到出現了下圖的錯誤訊息！心都涼了....hresult e_fail 已經從呼叫傳回至 com 元件&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/AVvXsEj1ocSqzNf0LX5-KFzikMbCGullRp8U801hkTMy7flx2hIUMEQ3RF8VI7GLtpIo05-jAxu-FzQ943VLelFn2E6kyXJR-6EPz66wz04QnLjV19nYnHjfchAUEYWiPJeibLpjEfLPd9A0fyo5/s1600/hresult+e_fail++SQL+ERR.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1ocSqzNf0LX5-KFzikMbCGullRp8U801hkTMy7flx2hIUMEQ3RF8VI7GLtpIo05-jAxu-FzQ943VLelFn2E6kyXJR-6EPz66wz04QnLjV19nYnHjfchAUEYWiPJeibLpjEfLPd9A0fyo5/s1600/hresult+e_fail++SQL+ERR.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div&gt;
再度去拜google大神之後，找到了方法，使用&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/ms180944.aspx&quot; target=&quot;_blank&quot;&gt;SQLcmd&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
語法如下：&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;sqlcmd&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&lt;strong&gt;-S&lt;/strong&gt;&amp;nbsp;伺服器名稱&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&lt;strong&gt;-U&lt;/strong&gt;&amp;nbsp;帳號&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&lt;strong&gt;-P&lt;/strong&gt;&amp;nbsp;密碼&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&lt;strong&gt;-d&lt;/strong&gt;&amp;nbsp;資料庫名稱&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #ff6600; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&lt;strong&gt;-i&lt;/strong&gt;&amp;nbsp;Script.sql&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Helvetica, Arial, &#39;LiHei Pro&#39;, PMingLiU, sans-serif; font-size: 15.199999809265137px; line-height: 30.399999618530273px;&quot;&gt;&lt;strong&gt;-o&amp;nbsp;&lt;/strong&gt;C:\log.txt&lt;/span&gt;&lt;/blockquote&gt;
會出現上圖的錯誤原因是因為SSMS一次無法讀取這麼大容量的檔案，&lt;br /&gt;
&lt;br /&gt;
所以要改採指令模式。&lt;br /&gt;
&lt;br /&gt;
測試指令模式也比較不吃系統資源，不會整個Hold在那邊！&lt;br /&gt;
&lt;br /&gt;
如果一次要執行多個檔案的話可以把SQL的指令寫成Bat！&lt;br /&gt;
&lt;br /&gt;
讓這個轉檔噩夢得以解脫！有更多的精神可以專注在其他該注意的事項上！&lt;br /&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
1.&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/ms180944.aspx&quot; target=&quot;_blank&quot;&gt;使用 sqlcmd 公用程式&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://fannys23.pixnet.net/blog/post/29336021&quot; target=&quot;_blank&quot;&gt;使用命令列模式執行大量 SQL 語法&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/4178433919315988749/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/07/restore-to-sql-server-2008-by-sqlcmd.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/4178433919315988749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/4178433919315988749'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/07/restore-to-sql-server-2008-by-sqlcmd.html' title='[SQL] - SQL Server 2008 R2 還原 SQL Server 2008 - PartII'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEj1ocSqzNf0LX5-KFzikMbCGullRp8U801hkTMy7flx2hIUMEQ3RF8VI7GLtpIo05-jAxu-FzQ943VLelFn2E6kyXJR-6EPz66wz04QnLjV19nYnHjfchAUEYWiPJeibLpjEfLPd9A0fyo5/s72-c/hresult+e_fail++SQL+ERR.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-3638494539146918125</id><published>2012-06-03T02:37:00.001+08:00</published><updated>2012-06-03T03:10:33.846+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASCII"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="CrystalReport"/><category scheme="http://www.blogger.com/atom/ns#" term="全形"/><category scheme="http://www.blogger.com/atom/ns#" term="半形"/><title type='text'>[C# .NET] - 半形轉換全形</title><content type='html'>半形字要轉換成全形字，在office上只要一顆按鈕就能達成了，&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
如果要透過.net去完成就變得很麻煩&lt;br /&gt;
&lt;br /&gt;
如何將A轉成Ａ呢？&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;網路上有幾套方法：&lt;br /&gt;
1.include Microsoft.VisualBasic;再使用其中的StrConv就能達到效果&lt;br /&gt;
2.做switch....去replace...&lt;br /&gt;
&lt;br /&gt;
今天要講的是第三種方法，利用ASCII編碼的特性轉換出全形字&lt;br /&gt;
&lt;br /&gt;
公式如下：&lt;br /&gt;
&lt;blockquote&gt;
A(65)+&lt;span style=&quot;color: red;&quot;&gt;65248&lt;/span&gt;=Ａ(65313)&lt;/blockquote&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/AVvXsEhM7T99MB96MwJ9PNIH1CcdlNhpcb7UGr6ETe_SxhsBtWpcYNKkCA9VFoM7J6IMlCqeJ5gInyXmIOQvi0InXI-bDofHdk560U5seyJEc4GUOgxuE1BNP7ZIBuLM_XUv3zOEweZNwqbglVMc/s1600/ASCII.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM7T99MB96MwJ9PNIH1CcdlNhpcb7UGr6ETe_SxhsBtWpcYNKkCA9VFoM7J6IMlCqeJ5gInyXmIOQvi0InXI-bDofHdk560U5seyJEc4GUOgxuE1BNP7ZIBuLM_XUv3zOEweZNwqbglVMc/s1600/ASCII.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
得到的Ａ數據是65313，這樣的話就可以透過原始的ASCII數值，去計算出全形的編碼數值&lt;br /&gt;
&lt;br /&gt;
不過這算是比較特殊解法，僅能運用在英數上，其他尚未去深入探討。&lt;br /&gt;
&lt;br /&gt;
有待有心人士往下研究。&lt;br /&gt;
&lt;br /&gt;
目前看起來只要是有支援ASCII的程式語言皆能使用，&lt;br /&gt;
&lt;br /&gt;
在Crystal Reports上也有嘗試過，也是可行滴！&lt;br /&gt;
&lt;br /&gt;
2012/06/03 By YC&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/3638494539146918125/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/06/c-sharp.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3638494539146918125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3638494539146918125'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/06/c-sharp.html' title='[C# .NET] - 半形轉換全形'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEhM7T99MB96MwJ9PNIH1CcdlNhpcb7UGr6ETe_SxhsBtWpcYNKkCA9VFoM7J6IMlCqeJ5gInyXmIOQvi0InXI-bDofHdk560U5seyJEc4GUOgxuE1BNP7ZIBuLM_XUv3zOEweZNwqbglVMc/s72-c/ASCII.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-7476457998166956023</id><published>2012-06-03T01:59:00.001+08:00</published><updated>2012-07-04T21:19:23.336+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="restore"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 R2"/><category scheme="http://www.blogger.com/atom/ns#" term="產生指令碼"/><category scheme="http://www.blogger.com/atom/ns#" term="還原bak"/><title type='text'>[SQL] - SQL Server 2008 R2 還原 SQL Server 2008 - PartI</title><content type='html'>SQL Server2008 R2要還原成SQL Server 2008真是一場惡夢，&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;某次很開心的拿到一個Bak檔，想要還原到本機的電腦上，

結果吐出了下面的錯誤訊息：

&lt;br /&gt;
&lt;blockquote&gt;
資料庫是在執行 10.50.1600.1 版的伺服器上備份。 該版本和此伺服器不相容，此伺服器目前執行 10.0.1600.22 版。 請將資料庫還原到支援此備份的伺服器，或使用與此伺服器相容的備份。&lt;/blockquote&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
看到這訊息整個都囧了...

拜Google大神才得知，2008 R2與2008是完全不相同的版本。&lt;br /&gt;
&lt;br /&gt;
但...應該有解吧...抱著這個信念繼續拜神...&lt;br /&gt;
&lt;br /&gt;
方法有幾種：&lt;br /&gt;
1.架一台2008 R2將bak還原，然後再用匯入的方式將資料庫匯入2008的主機&lt;br /&gt;
2.不轉出bak檔案，透過產生指令碼的工具去產生資料。&lt;br /&gt;
&lt;br /&gt;
不過今天要介紹的是第二種方法，方法如下：&lt;br /&gt;
&lt;br /&gt;
1.點選DB按右鍵，選工作-&amp;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/AVvXsEj9Uyy-BEr-NoABr8-0xyaAMRlYzu9IQFXjfMnXhG7oR9RPl450_7QWS6WeprGf7-trZxQt8zKeES0YLycY858axLG_xEw72J8yfz6M5hVC1y5aiNwP4F83lbDxJWhkxO8XvdkK_Bj798qq/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC.png&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; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9Uyy-BEr-NoABr8-0xyaAMRlYzu9IQFXjfMnXhG7oR9RPl450_7QWS6WeprGf7-trZxQt8zKeES0YLycY858axLG_xEw72J8yfz6M5hVC1y5aiNwP4F83lbDxJWhkxO8XvdkK_Bj798qq/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC.png&quot; width=&quot;279&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;2.開啟畫面。&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/AVvXsEj2SC1PG6BmWxH5jKyEZ-n3QuJI09hKh_RQnhBRMCizvgaAZixmBRzg7Nl2Zh-Ir8xqm8NgWWqgbEAwCIJwkrVTBe_WX5VhxKmOc6GUJbT0LswtNJ6zlqZEHi0RKWDC72PsdvJNgCm1o_bD/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2SC1PG6BmWxH5jKyEZ-n3QuJI09hKh_RQnhBRMCizvgaAZixmBRzg7Nl2Zh-Ir8xqm8NgWWqgbEAwCIJwkrVTBe_WX5VhxKmOc6GUJbT0LswtNJ6zlqZEHi0RKWDC72PsdvJNgCm1o_bD/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
3.設定要轉出的資料&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/AVvXsEioT1QZlp43AYzc2dFep7A8_03noAF0_A8z6s7uYOKLVKuqhxtaTUd1EuG6zYxT-M81DM4P3qbdm1MdBJ_SgWn3BQ_kLNiVnGYz2LcxeNDPs8at6hP7PCTtsuxq9lh3SkEiKl0kdtGy5cOH/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioT1QZlp43AYzc2dFep7A8_03noAF0_A8z6s7uYOKLVKuqhxtaTUd1EuG6zYxT-M81DM4P3qbdm1MdBJ_SgWn3BQ_kLNiVnGYz2LcxeNDPs8at6hP7PCTtsuxq9lh3SkEiKl0kdtGy5cOH/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;4.設定要轉出的方式，建議選每一物件單一檔案，會比較方便處理&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/AVvXsEhkB5s7JNSCgHdkCtnvreUKYil96fEKi6Oc6WpTjUtkBK-rGYalTxpBOYtbiYXIAXKryN0RUGuZ_QQlYA811GVS6CRc3a_UmqAS8EMcNoB1BRQmIUE7aJmEqOpj1oYbFmDwW0XqQ6QkPpku/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkB5s7JNSCgHdkCtnvreUKYil96fEKi6Oc6WpTjUtkBK-rGYalTxpBOYtbiYXIAXKryN0RUGuZ_QQlYA811GVS6CRc3a_UmqAS8EMcNoB1BRQmIUE7aJmEqOpj1oYbFmDwW0XqQ6QkPpku/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;5.按下圖4進階按鈕後可以選要轉出什麼資料類型，這邊依照需要去做調整，如是要轉出資料的話可以選僅限資料&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/AVvXsEhAbK7K0j5_g3WQlEb3IQOKu9Eez7ZbWt1IEHyWachSZ__QsNNJ5fVrvqTNzld52pDXutk9Bx61CD8x9XmDSHlf5nV5tc91C45d5dpmcfiXUG_ju0wJu66oANW6TfiW7SOOTqAGHr7mEoMd/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;267&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAbK7K0j5_g3WQlEb3IQOKu9Eez7ZbWt1IEHyWachSZ__QsNNJ5fVrvqTNzld52pDXutk9Bx61CD8x9XmDSHlf5nV5tc91C45d5dpmcfiXUG_ju0wJu66oANW6TfiW7SOOTqAGHr7mEoMd/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;6.顯示設定摘要&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/AVvXsEj6Q9D03nKR3MdhAKiHy750oidiVBBnXKoNqzyd-B1HaY-RUVzEF-VPQgpbB9hmfmrE80OuhoejREFIkBWVb-9RdyPjOzbqf4UhUEsIsNgjIzsyhPB2hKAgpLANstzaPdlQXKvifc-4dwx4/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6Q9D03nKR3MdhAKiHy750oidiVBBnXKoNqzyd-B1HaY-RUVzEF-VPQgpbB9hmfmrE80OuhoejREFIkBWVb-9RdyPjOzbqf4UhUEsIsNgjIzsyhPB2hKAgpLANstzaPdlQXKvifc-4dwx4/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;7.轉換開始&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/AVvXsEj4KbWDKuuM6UHk2Y2FBeSA2SaNRyCDrUZPtofkiBiZWpHm2_254QGXqVP5cKEMUEZ2WEJvomY4UZq4jYPbi38pxlQB_HMi3Mxt0dxGzC37viPNncLG4XG6nvuNzlEbIgniVJTRscxMxNFB/s1600/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4KbWDKuuM6UHk2Y2FBeSA2SaNRyCDrUZPtofkiBiZWpHm2_254QGXqVP5cKEMUEZ2WEJvomY4UZq4jYPbi38pxlQB_HMi3Mxt0dxGzC37viPNncLG4XG6nvuNzlEbIgniVJTRscxMxNFB/s320/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
轉換完之後只要透過SQL Server的查詢視窗將產生的sql檔案打開就可以囉！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
真是不方便的方法....資料表很多就要轉到天荒地老....&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
期待微軟未來能改善這方面的問題&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
1.&lt;a href=&quot;http://sharedderrick.blogspot.tw/2010/10/sql-server-2008-r2-sql-server-2008.html&quot;&gt;http://sharedderrick.blogspot.tw/2010/10/sql-server-2008-r2-sql-server-2008.html&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/bb326466.aspx&quot;&gt;http://msdn.microsoft.com/zh-tw/library/bb326466.aspx&lt;/a&gt;&lt;br /&gt;
3.&lt;a href=&quot;http://ithelp.ithome.com.tw/question/10064443&quot;&gt;http://ithelp.ithome.com.tw/question/10064443&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/7476457998166956023/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/06/sqlserver-2008-r2-restore-to-2008.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/7476457998166956023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/7476457998166956023'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/06/sqlserver-2008-r2-restore-to-2008.html' title='[SQL] - SQL Server 2008 R2 還原 SQL Server 2008 - PartI'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEj9Uyy-BEr-NoABr8-0xyaAMRlYzu9IQFXjfMnXhG7oR9RPl450_7QWS6WeprGf7-trZxQt8zKeES0YLycY858axLG_xEw72J8yfz6M5hVC1y5aiNwP4F83lbDxJWhkxO8XvdkK_Bj798qq/s72-c/SQL%E7%94%A2%E7%94%9F%E6%8C%87%E4%BB%A4%E7%A2%BC.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-2514875940533665962</id><published>2012-05-25T19:55:00.002+08:00</published><updated>2012-05-25T20:24:11.220+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Syntax Highlighting"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2010 Tool"/><title type='text'>[VS2010 Tool] - SQL Syntax Highlighting</title><content type='html'>今天要介紹一款開發程式的方便小工具!&lt;br /&gt;
&lt;br /&gt;
SQL Syntax Highlighting&lt;br /&gt;
&lt;br /&gt;
網址：&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/a3a662c6-28eb-4de9-9a29-d328b1ac3f6b&quot;&gt;http://visualstudiogallery.msdn.microsoft.com/a3a662c6-28eb-4de9-9a29-d328b1ac3f6b&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
用途：SQL語法顏色區別，樣式與SQL Server的查詢畫面相近&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
效果如下圖：&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&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/AVvXsEhIFPt4AHqEN3BEU3O7tKIxmMwpUn2sSXp7IisdiAhe_CjjyWXEpCWYluJ6M-ZZSZOSh3eL_4mvis2sl8hpyRtgAgAESygGwIgkjHL9N287wRH-gQekjG6PiBQI7cAH4F0_phErOzN-MZmj/s1600/highlight.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;81&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIFPt4AHqEN3BEU3O7tKIxmMwpUn2sSXp7IisdiAhe_CjjyWXEpCWYluJ6M-ZZSZOSh3eL_4mvis2sl8hpyRtgAgAESygGwIgkjHL9N287wRH-gQekjG6PiBQI7cAH4F0_phErOzN-MZmj/s320/highlight.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
後記：有發現一個小缺陷是在某些非SQL語法的地方也會出現Highlight的誤判狀況，不過不太影響觀瞻，寫語法更加方便了。&lt;br /&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/2514875940533665962/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/05/sql-syntax-highlighting.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2514875940533665962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2514875940533665962'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/05/sql-syntax-highlighting.html' title='[VS2010 Tool] - SQL Syntax Highlighting'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEhIFPt4AHqEN3BEU3O7tKIxmMwpUn2sSXp7IisdiAhe_CjjyWXEpCWYluJ6M-ZZSZOSh3eL_4mvis2sl8hpyRtgAgAESygGwIgkjHL9N287wRH-gQekjG6PiBQI7cAH4F0_phErOzN-MZmj/s72-c/highlight.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-7665041693656781586</id><published>2012-05-25T19:53:00.000+08:00</published><updated>2012-05-25T20:21:25.550+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Highlight"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2010 Tool"/><title type='text'>[VS2010 Tool] - Highlight all occurrences of selected word</title><content type='html'>今天要介紹一款開發程式的方便小工具!&lt;br /&gt;
&lt;br /&gt;
Highlight all occurrences of selected word&lt;br /&gt;
&lt;br /&gt;
網址：&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/4b92b6ad-f563-4705-8f7b-7f85ba3cc6bb&quot;&gt;http://visualstudiogallery.msdn.microsoft.com/4b92b6ad-f563-4705-8f7b-7f85ba3cc6bb&lt;/a&gt;&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
用途：將選取的字做螢光筆標記。&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&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/AVvXsEhIFPt4AHqEN3BEU3O7tKIxmMwpUn2sSXp7IisdiAhe_CjjyWXEpCWYluJ6M-ZZSZOSh3eL_4mvis2sl8hpyRtgAgAESygGwIgkjHL9N287wRH-gQekjG6PiBQI7cAH4F0_phErOzN-MZmj/s1600/highlight.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIFPt4AHqEN3BEU3O7tKIxmMwpUn2sSXp7IisdiAhe_CjjyWXEpCWYluJ6M-ZZSZOSh3eL_4mvis2sl8hpyRtgAgAESygGwIgkjHL9N287wRH-gQekjG6PiBQI7cAH4F0_phErOzN-MZmj/s400/highlight.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
後記：&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;面對龐大的程式碼，再也不會找不到參數了！T.T&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/7665041693656781586/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/05/highlight-all-occurrences-of-selected.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/7665041693656781586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/7665041693656781586'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/05/highlight-all-occurrences-of-selected.html' title='[VS2010 Tool] - Highlight all occurrences of selected word'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEhIFPt4AHqEN3BEU3O7tKIxmMwpUn2sSXp7IisdiAhe_CjjyWXEpCWYluJ6M-ZZSZOSh3eL_4mvis2sl8hpyRtgAgAESygGwIgkjHL9N287wRH-gQekjG6PiBQI7cAH4F0_phErOzN-MZmj/s72-c/highlight.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>408台灣台中市</georss:featurename><georss:point>24.166802085303239 120.5859375</georss:point><georss:box>20.44922958530324 115.53222650000001 27.884374585303238 125.63964849999999</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-4024816646904538073</id><published>2012-03-20T21:05:00.001+08:00</published><updated>2012-03-20T21:26:55.699+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="WMI"/><category scheme="http://www.blogger.com/atom/ns#" term="WMI Explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="WQL"/><category scheme="http://www.blogger.com/atom/ns#" term="工具資源"/><title type='text'>[C#] - WMIExplorer</title><content type='html'>[軟體名稱]
WMI Explorer&lt;br /&gt;
[官方網站]
&lt;a href=&quot;http://www.ks-soft.net/hostmon.eng/wmi/index.htm&quot;&gt;http://www.ks-soft.net/hostmon.eng/wmi/index.htm&lt;/a&gt;&lt;br /&gt;
[說明]WMIExplorer是一套用來查詢WMI資料的小工具&lt;br /&gt;
提供了完整的類別資訊和其中所帶的屬性資料
&lt;a name=&#39;more&#39;&gt;&lt;/a&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/AVvXsEjt-THYQUTDbgOKmo0WhAGTsUqmJvupkXgnkhuuMY7NtyxyKOqkJYFlo-Ny_2qdw2MXDBIEwJ1qSCGreKhG_jtg2HSvwAveSkII8OvWgG2iabdThpiNCdK6SWKenCe0E_viTQHssw5iTV1j/s1600/WMI-1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;433&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt-THYQUTDbgOKmo0WhAGTsUqmJvupkXgnkhuuMY7NtyxyKOqkJYFlo-Ny_2qdw2MXDBIEwJ1qSCGreKhG_jtg2HSvwAveSkII8OvWgG2iabdThpiNCdK6SWKenCe0E_viTQHssw5iTV1j/s640/WMI-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
除了用點選的方式還能用下SQL的方式去執行已取得更詳盡的資料
&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/AVvXsEivwFF2S1xf2zChCekWRnmOuc7n2aFzO2xfub3kFFAKzUj08pIRo32j5b2Yq2NlDJkdqEwJ7zYJerjO6lAnNaN2O0A07Fd2-MCe0hiqnrIoT2SfeH0XWoucHOfDeMEj1cVfrA_N4QKs5V03/s1600/WMI-2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;433&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivwFF2S1xf2zChCekWRnmOuc7n2aFzO2xfub3kFFAKzUj08pIRo32j5b2Yq2NlDJkdqEwJ7zYJerjO6lAnNaN2O0A07Fd2-MCe0hiqnrIoT2SfeH0XWoucHOfDeMEj1cVfrA_N4QKs5V03/s640/WMI-2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
譬如以&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
SELECT &amp;nbsp;* &amp;nbsp;FROM Win32_NetworkAdapter&lt;/blockquote&gt;
&lt;br /&gt;
可以查詢到Client的網路相關的資料，其中包含了硬體網路卡與虛擬網路卡...等資訊，&lt;br /&gt;
&lt;br /&gt;
比較方便的是可以在寫程式的過程中縮短找參數的時間及測試SQL是否有達成要的結果。</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/4024816646904538073/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/03/c-wmiexplorer.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/4024816646904538073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/4024816646904538073'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/03/c-wmiexplorer.html' title='[C#] - WMIExplorer'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEjt-THYQUTDbgOKmo0WhAGTsUqmJvupkXgnkhuuMY7NtyxyKOqkJYFlo-Ny_2qdw2MXDBIEwJ1qSCGreKhG_jtg2HSvwAveSkII8OvWgG2iabdThpiNCdK6SWKenCe0E_viTQHssw5iTV1j/s72-c/WMI-1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-2008410657547067528</id><published>2012-03-20T00:43:00.003+08:00</published><updated>2012-03-20T01:05:13.296+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="network adapter"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Win32_NetworkAdapter"/><category scheme="http://www.blogger.com/atom/ns#" term="WMI"/><category scheme="http://www.blogger.com/atom/ns#" term="WQL"/><title type='text'>[C#] - 透過WMI Win32_NetworkAdapter取得MAC</title><content type='html'>今天要介紹的是透過WMI來取得系統的資訊，&lt;br /&gt;
&lt;br /&gt;
.NET提供了幾個類別用於取得WMI所管理的資訊，&lt;br /&gt;
&lt;br /&gt;
其中包含了硬體資訊和系統資訊。&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;接下來說明如何取得網卡上的位址(MAC Address)&lt;br /&gt;
&lt;br /&gt;
1.首先透過ManagementObjectSearcher執行&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa394606(VS.85).aspx&quot;&gt;WQL&lt;/a&gt;(&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px; text-align: left;&quot;&gt;WMI Query Language)&lt;/span&gt;&lt;br /&gt;
2.使用ManagementObjectCollection取得查詢回傳的集合&lt;br /&gt;
3.最後使用ManagementObject來逐一分析比對，取得所要的資料。&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Sample：&lt;span style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;           
ManagementObjectSearcher query = new ManagementObjectSearcher(@&quot;SELECT * 
                                     FROM Win32_NetworkAdapter &quot;);
 ManagementObjectCollection queryCollection = query.Get();
            foreach (ManagementObject mo in queryCollection)
            {
                Console.WriteLine(mo[&quot;MacAddress&quot;].ToString().Replace(&quot;:&quot;, &quot;&quot;));
            }

&lt;/pre&gt;
做到這邊想必會想說如何取得MacAddress這個Properties吧！
&lt;br /&gt;
&lt;br /&gt;
下面的程式可以取得這個ManagementObject所有的Properties這樣就能逐一找到需要的Properties了。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;foreach (PropertyData prop in mo.Properties)
            {
                if (prop.Value!= null)
                    Console.WriteLine(&quot;{0}: {1}&quot;, prop.Name, prop.Value);
            }&lt;/pre&gt;
&lt;br /&gt;
參考出處：&lt;br /&gt;
1.&lt;a href=&quot;http://weblogs.sqlteam.com/mladenp/archive/2010/11/04/find-only-physical-network-adapters-with-wmi-win32_networkadapter-class.aspx&quot;&gt;Find only physical network adapters with WMI Win32_NetworkAdapter class&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa394606(VS.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa394606(VS.85).aspx&lt;/a&gt;&lt;br /&gt;
3.&lt;a href=&quot;http://stackoverflow.com/questions/1525320/how-to-enumerate-audio-out-devices-in-c-sharp&quot;&gt;http://stackoverflow.com/questions/1525320/how-to-enumerate-audio-out-devices-in-c-sharp&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/2008410657547067528/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2012/03/get-networkadapters-with-wmi.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2008410657547067528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2008410657547067528'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2012/03/get-networkadapters-with-wmi.html' title='[C#] - 透過WMI Win32_NetworkAdapter取得MAC'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-8297958992069908433</id><published>2011-12-25T21:20:00.001+08:00</published><updated>2012-01-27T23:14:12.428+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="XML Editor"/><category scheme="http://www.blogger.com/atom/ns#" term="XMLQuire"/><category scheme="http://www.blogger.com/atom/ns#" term="Xpath"/><category scheme="http://www.blogger.com/atom/ns#" term="XPath Editor"/><category scheme="http://www.blogger.com/atom/ns#" term="xpath tool"/><category scheme="http://www.blogger.com/atom/ns#" term="工具資源"/><title type='text'>[C#] - XMLQuire</title><content type='html'>當我們在使用Xpath的方法時，總是為了兜Xpath路徑花了不少時間，&lt;br /&gt;
&lt;br /&gt;
心想應該有更快的方法可以去找到這串Xpath，&lt;br /&gt;
&lt;br /&gt;
上網資料挖到了一個不錯用的工具&lt;a href=&quot;http://qutoric.com/xmlquire/&quot;&gt;XMLQuire&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;[軟體名稱]XMLQuire&lt;br /&gt;
[官方網站]&lt;a href=&quot;http://qutoric.com/&quot;&gt;http://qutoric.com&lt;/a&gt;&lt;span id=&quot;goog_204615202&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_204615203&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;br /&gt;
[說明]XMLQuire包含了XML Editor和XPath Editor，其中有一個功能很棒!!當我們拔游標點到哪個節點時，
就會自動產生一個Xpath，超貼心的！&lt;br /&gt;
&lt;br /&gt;
這樣可以大大的縮短測試的時間。

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlT4Q5gqdqB26n8kpYLRXJYSlGyiGzaVYwn8DwMMAPBIRBIWC97bjaI9zJEFGahAu7oOcNKbZJYyP33zxgc_Ekffd1WNR5YXZ_yZyg7-8_fkDPQ9kRJpmXSXeEghHTerN3MFNLDRgnWeWx/s1600/XMLQuire.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlT4Q5gqdqB26n8kpYLRXJYSlGyiGzaVYwn8DwMMAPBIRBIWC97bjaI9zJEFGahAu7oOcNKbZJYyP33zxgc_Ekffd1WNR5YXZ_yZyg7-8_fkDPQ9kRJpmXSXeEghHTerN3MFNLDRgnWeWx/s640/XMLQuire.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/8297958992069908433/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/12/c-sharp-xpath-tool-xmlquire.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8297958992069908433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8297958992069908433'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/12/c-sharp-xpath-tool-xmlquire.html' title='[C#] - XMLQuire'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEhlT4Q5gqdqB26n8kpYLRXJYSlGyiGzaVYwn8DwMMAPBIRBIWC97bjaI9zJEFGahAu7oOcNKbZJYyP33zxgc_Ekffd1WNR5YXZ_yZyg7-8_fkDPQ9kRJpmXSXeEghHTerN3MFNLDRgnWeWx/s72-c/XMLQuire.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-2794252945303473721</id><published>2011-12-17T20:38:00.000+08:00</published><updated>2012-01-27T23:14:11.839+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="MaxLength"/><category scheme="http://www.blogger.com/atom/ns#" term="MultiLine"/><category scheme="http://www.blogger.com/atom/ns#" term="TextArea"/><category scheme="http://www.blogger.com/atom/ns#" term="TextBox"/><category scheme="http://www.blogger.com/atom/ns#" term="TextMode"/><title type='text'>[Asp.net] - TextBox.MaxLength在 MultiLine下無效果</title><content type='html'>最近在做TextBox限制長度大小時， 很開心的使用多行的功能時，又寫了限制字數的大小&lt;br /&gt;
&lt;br /&gt;
詭異的事情發生了！！怎麼還是可以打超過字元...我明明寫了MaxLength=＂10＂&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;pre class=&quot;brush: csharp;&quot;&gt;&lt;asp:textbox id=&quot;t&quot; maxlength=&quot;10&quot; row=&quot;2&quot; runat=&quot;server&quot; textmode=&quot;MultiLine&quot;&gt;&lt;/asp:textbox&gt;&lt;/pre&gt;
&lt;br /&gt;
不死心的在瀏覽模式下檢視原始碼...&lt;br /&gt;
&lt;br /&gt;
竟然發現TextBox轉譯成TextArea格式，而且MaxLength這個屬性不見了!!&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5rjtWU7u8iCt-JhIFqloRldOI0TuNfThym4BER7JBWNKV8oew0vqS9FannRBfukwg5OuvkYqEDUuvnKYUMUXq-oWxXu05qAM79-s_7L8BFSDgs43kb6dA0ehma31dSNBCvHI_cS4Y_-kv/s1600/TextArea.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5rjtWU7u8iCt-JhIFqloRldOI0TuNfThym4BER7JBWNKV8oew0vqS9FannRBfukwg5OuvkYqEDUuvnKYUMUXq-oWxXu05qAM79-s_7L8BFSDgs43kb6dA0ehma31dSNBCvHI_cS4Y_-kv/s640/TextArea.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
又比對了沒有下TextMode=＂MultiLine＂屬性的結果，&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
TextBox轉成了input，而且
MaxLength有出現！！！&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5rjtWU7u8iCt-JhIFqloRldOI0TuNfThym4BER7JBWNKV8oew0vqS9FannRBfukwg5OuvkYqEDUuvnKYUMUXq-oWxXu05qAM79-s_7L8BFSDgs43kb6dA0ehma31dSNBCvHI_cS4Y_-kv/s1600/TextArea.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmfwie5rnR57CDq1ivdC7_mC1pARr0UUEIKoA3ZbSZhmzpJpYxmvua3uerfgwJkEGOg4DCqo-lRTWJgCK-tR0p27rYXsJBLuHRTPo5_ikM_UW_nKkhaz6-BjwlqPxO8Z-UUBoPQtCyyI_U/s1600/TextBox.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmfwie5rnR57CDq1ivdC7_mC1pARr0UUEIKoA3ZbSZhmzpJpYxmvua3uerfgwJkEGOg4DCqo-lRTWJgCK-tR0p27rYXsJBLuHRTPo5_ikM_UW_nKkhaz6-BjwlqPxO8Z-UUBoPQtCyyI_U/s640/TextBox.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
後來上網查了資料才知道已經有許多先進遇到這種詭譎的問題了！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
後來推測是因為.net在轉換Html時，如果是多行模式會轉成TextArea這個標籤&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
而TextArea本身沒有提供MaxLength屬性，&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
解決的方法有二：&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
1.一位保哥的Blog，提供修改過的TextBox物件，可以在MultiLine模式下提供字元限字的方法&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;http://blog.miniasp.com/post/2008/05/04/TextBox-TextMode-MultiLine-use-MaxLength-property.aspx&quot;&gt;TextBox 在 MultiLine 模式時無法使用 MaxLength 屬性&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
2.使用JavaScript來做Client的控管，個人比較偏好這個，簡單明瞭。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;http://pramaire.pixnet.net/blog/post/22512127-textbox%E5%9C%A8textmode%3Dmultiline%E7%8B%80%E6%85%8B%E4%B8%8Bmaxlength%E7%9A%84%E5%AD%97%E6%95%B8%E9%99%90&quot;&gt;TextBox在Textmode=MultiLine狀態下MaxLength的字數限制無效&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: js;&quot;&gt;function ismaxlength(obj){
  var mlength=obj.getAttribute? parseInt(obj.getAttribute(&quot;maxlength&quot;)) : &quot;&quot;;
  if (obj.getAttribute &amp;amp;&amp;amp; obj.value.length&amp;gt;mlength)
    obj.value=obj.value.substring(0,mlength);
}&lt;/pre&gt;
&lt;br /&gt;
後端程式要加上下面兩行&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;
  TextBox1.Attributes.Add(&quot;maxlength&quot;, &quot;200&quot;);
//給TextArea maxlength屬性，目前測試是沒辦法直接在TextBox上加
//.net不會把maxlength屬性加上到TextArea標籤上
  TextBox1.Attributes.Add(&quot;onkeyup&quot;, &quot;return ismaxlength(this)&quot;);
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;
這樣就大功告成囉~!</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/2794252945303473721/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/12/aspnet-textbox-multiline-maxlength-is.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2794252945303473721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/2794252945303473721'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/12/aspnet-textbox-multiline-maxlength-is.html' title='[Asp.net] - TextBox.MaxLength在 MultiLine下無效果'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEh5rjtWU7u8iCt-JhIFqloRldOI0TuNfThym4BER7JBWNKV8oew0vqS9FannRBfukwg5OuvkYqEDUuvnKYUMUXq-oWxXu05qAM79-s_7L8BFSDgs43kb6dA0ehma31dSNBCvHI_cS4Y_-kv/s72-c/TextArea.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-1034570095397156318</id><published>2011-12-04T13:48:00.001+08:00</published><updated>2011-12-04T14:10:44.620+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="syntaxhighlighter"/><title type='text'>在bolgger中加入code方塊partIII-使用SyntaxHighlighter 3.0.833.0</title><content type='html'>用了很久的SyntaxHighlighter 1.X&lt;/br&gt;
&lt;/br&gt;
最近逛其他Blog時發現新的樣式，&lt;/br&gt;
&lt;/br&gt;
Google後才知道原來是SyntaxHighlighter又升級了!!&lt;/br&gt;
&lt;/br&gt;
迫不及待就去官方看說明，越做越棒！使用方法還是一樣簡單
&lt;/br&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
&lt;/br&gt;
1.從&lt;a href=&quot;http://alexgorbatchev.com/SyntaxHighlighter/&quot;&gt;官方網站下載&lt;/a&gt;最新版本的檔案。
&lt;/br&gt;&lt;/br&gt;
2.找一個免費的空間放這些js檔案，&lt;a href=&quot;http://yanchi-huang.blogspot.com/2011/05/dropbox.html&quot;&gt;DropBox&lt;/a&gt;或Skydrive都是不錯的選擇(因為他們支援外連連結)&lt;/br&gt;&lt;/br&gt;
3.編輯Blogger的HTML，在＜/Body＞後面加上下面這一串JS&lt;/br&gt;
&lt;pre class=&quot;brush: js;&quot;&gt;
&lt;link href=&#39;/styles/shCoreDefault.css&#39; rel=&#39;stylesheet&#39; type=&#39;text/css&#39;/&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shCore.js&#39;&gt;  
&lt;/script&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shBrushCpp.js&#39;&gt;
&lt;/script&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shBrushCSharp.js&#39;&gt;
&lt;/script&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shBrushCss.js&#39;&gt;
&lt;/script&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shBrushJScript.js&#39;&gt;
&lt;/script&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shBrushSql.js&#39;&gt;
&lt;/script&gt; 
&lt;script language=&#39;javascript&#39; src=&#39;/scripts/shBrushXml.js&#39;&gt;
&lt;/script&gt;        
&lt;script type=&#39;text/javascript&#39;&gt;
     SyntaxHighlighter.all()
&lt;/script&gt;
&lt;/pre&gt;&lt;/br&gt;
4.最後只要在文章裡面加上＜pre class=&quot;brush: js;&quot;＞＜/pre＞&lt;/br&gt;
&lt;pre class=&quot;brush: js;&quot;&gt;
＜pre class=&quot;brush: js;&quot;＞＜/pre＞
&lt;/pre&gt;


其他的相關資訊都可以從官網上取得~還蠻清楚的!</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/1034570095397156318/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/12/syntaxhighlighter-308330.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/1034570095397156318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/1034570095397156318'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/12/syntaxhighlighter-308330.html' title='在bolgger中加入code方塊partIII-使用SyntaxHighlighter 3.0.833.0'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-6777807819670368785</id><published>2011-11-19T15:06:00.001+08:00</published><updated>2012-01-27T23:14:12.100+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="colspan"/><category scheme="http://www.blogger.com/atom/ns#" term="Columns"/><category scheme="http://www.blogger.com/atom/ns#" term="DataGrid"/><category scheme="http://www.blogger.com/atom/ns#" term="GridView"/><category scheme="http://www.blogger.com/atom/ns#" term="Label"/><category scheme="http://www.blogger.com/atom/ns#" term="Rows"/><category scheme="http://www.blogger.com/atom/ns#" term="rowspan"/><category scheme="http://www.blogger.com/atom/ns#" term="巢狀"/><category scheme="http://www.blogger.com/atom/ns#" term="跨資料行"/><title type='text'>[ASP.net][C#] -DataGrid 巢狀顯示資料</title><content type='html'>當我們要使用DataGrid要顯示大量資料時，偏偏某幾個欄位字數特別的多，&lt;br /&gt;
&lt;br /&gt;
若沒有做字數處理的話，畫面肯定會跑掉而且醜不拉嘰，&lt;br /&gt;
&lt;br /&gt;
重點來了，我們要如何把資料弄得齊全又讓使用者看得開心呢？&lt;br /&gt;
&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/AVvXsEiSX0lr7UPSiR_gjwsbr3Qx81hyxmGIBpbfHVUaoHQ2qvPcVLyeqOYGig8ZdosmPpfCEU1XwNfvSGooXW48-zipJbhtMI0ZPO-hgi4qefvIcmSf-sedBCBZdAGxu8iExNsHpDn58VK56uWl/s1600/DataGrid_span.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSX0lr7UPSiR_gjwsbr3Qx81hyxmGIBpbfHVUaoHQ2qvPcVLyeqOYGig8ZdosmPpfCEU1XwNfvSGooXW48-zipJbhtMI0ZPO-hgi4qefvIcmSf-sedBCBZdAGxu8iExNsHpDn58VK56uWl/s640/DataGrid_span.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
一開始做的時候也以為會很難，做完感覺其實就是Table的應用而已！&lt;br /&gt;
&lt;br /&gt;
1.首先我們先做一個DataGrid&lt;br /&gt;
(Client畫面設計)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;    &lt;asp:datagrid autogeneratecolumns=&quot;False&quot; id=&quot;Grid&quot; onitemdatabound=&quot;Grid_ItemDataBound&quot; runat=&quot;server&quot;&gt;
    &lt;alternatingitemstyle backcolor=&quot;AliceBlue&quot;/&gt;
    &lt;itemstyle backcolor=&quot;LawnGreen&quot;/&gt;
    &lt;columns&gt;
    &lt;asp:boundcolumn datafield=&quot;No&quot; headertext=&quot;序&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;Name&quot; headertext=&quot;姓名&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;Chi&quot; headertext=&quot;國文&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;Eng&quot; headertext=&quot;英文&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;Math&quot; headertext=&quot;數學&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;Bio&quot; headertext=&quot;生物&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;DB&quot; headertext=&quot;資料庫&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;OS&quot; headertext=&quot;作業系統&quot;/&gt;
    &lt;asp:boundcolumn datafield=&quot;Des&quot; headertext=&quot;評語&quot;/&gt;
    &lt;/columns&gt;
    &lt;/asp:datagrid&gt;&lt;/pre&gt;
&lt;br /&gt;
(Behind)&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add(&quot;No&quot;, typeof(Int32));
            dt.Columns.Add(&quot;Name&quot;, typeof(string));
            dt.Columns.Add(&quot;Chi&quot;, typeof(string));
            dt.Columns.Add(&quot;Math&quot;, typeof(string));
            dt.Columns.Add(&quot;Eng&quot;, typeof(string));
            dt.Columns.Add(&quot;Bio&quot;, typeof(string));
            dt.Columns.Add(&quot;DB&quot;, typeof(string));
            dt.Columns.Add(&quot;OS&quot;, typeof(string));
            dt.Columns.Add(&quot;Des&quot;, typeof(string));
            Random r=new Random();
            for (int i = 1; i &amp;lt; 10; i++)
            {
                dt.Rows.Add(new object[] { i, &quot;學生&quot; + i, r.Next(0, 100), r.Next(0, 100), 
                    r.Next(0, 100), r.Next(0, 100), r.Next(0, 100), r.Next(0, 100)
                    , &quot;當某一欄資料字數很多的時候可以做成兩列的方式來展示，可以讓畫面更加好看&quot; });
            }
            Grid.DataSource = dt;
            Grid.DataBind();
        }

&lt;/pre&gt;
&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/AVvXsEjdVOcjRa76ZS8dzNgTbYUeP7mH_Kp_JT1kuAPzM-pj4Gcpe_EWlIS47kXmcfbryaWY7uEKMD-7zrGbiznpB29puVcFPcfzUMrmV0IdXegJfpFcFIXElJ_EUCM9CmejECJS3IORi1GwpWGm/s1600/DataGrid_no_span.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdVOcjRa76ZS8dzNgTbYUeP7mH_Kp_JT1kuAPzM-pj4Gcpe_EWlIS47kXmcfbryaWY7uEKMD-7zrGbiznpB29puVcFPcfzUMrmV0IdXegJfpFcFIXElJ_EUCM9CmejECJS3IORi1GwpWGm/s640/DataGrid_no_span.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
接下來開始進行改造！
&lt;br /&gt;
&lt;br /&gt;
2.先把評語那一列 Visible改成false，這行是為了稍後抓資料方便！
&lt;br /&gt;
&lt;pre class=&quot;C#&quot; name=&quot;code&quot;&gt;&lt;asp:boundcolumn datafield=&quot;Des&quot; headertext=&quot;評語&quot; visible=&quot;false&quot;&gt;
&lt;/asp:boundcolumn&gt;&lt;/pre&gt;
&lt;br /&gt;
3.在DataGrid加上onitemdatabound事件，第二列的資料要靠這個事件觸發產生！&lt;br /&gt;
&lt;pre class=&quot;C#&quot; name=&quot;code&quot;&gt;onitemdatabound=&quot;Grid_ItemDataBound&quot;
&lt;/pre&gt;
&lt;br /&gt;
4.在Behind的Grid_ItemDataBound加上今天的主角！&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;　　　　　　　　if (e.Item.ItemType == ListItemType.Item)//單數列
            {
                Label Des = new Label();
                Des.Text = e.Item.Cells[8].Text;//取值
                DataGridItem Item = new DataGridItem(0, -1, ListItemType.Item);//宣告一個資料列物件
                Item.BackColor = Grid.ItemStyle.BackColor;//設定Item的顏色
                TableCell cell = new TableCell();//宣告一個cell放資料
                cell.Controls.Add(Des);
                cell.Attributes.Add(&quot;colspan&quot;, &quot;7&quot;);//設定跨欄的屬性以及要跨幾欄
                Item.Cells.Add(cell);//把cell塞進去資料列裡面
                e.Item.Parent.Controls.Add(Item);//把資料列塞到DataGrid裡面
            }
            if (e.Item.ItemType == ListItemType.AlternatingItem)//偶數列
            {
                //.DataGrid-AlternatingItem
                Label Des = new Label();
                Des.Text = e.Item.Cells[8].Text;
                DataGridItem Item = new DataGridItem(0, -1, ListItemType.Item);
                Item.BackColor = Grid.AlternatingItemStyle.BackColor;
                TableCell cell = new TableCell();
                cell.Controls.Add(Des);
                cell.Attributes.Add(&quot;colspan&quot;, &quot;7&quot;);
                Item.Cells.Add(cell);
                e.Item.Parent.Controls.Add(Item);
            }
&lt;/pre&gt;
&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/AVvXsEiTFZc85b24nn7BRn_UDuu-MkfDAnkNVY6ufsD7b6ov1iJO0_AH-GUh_7_yPVRjBFS-I7hacMSBJ2MEaiUt1UaLWxbou8BOmmDdOhvFnO82Q9zLBRMlnqWavfxUzbwmOZ2_RTl4HwLyp3AL/s1600/DataGrid_colspan.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;481&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTFZc85b24nn7BRn_UDuu-MkfDAnkNVY6ufsD7b6ov1iJO0_AH-GUh_7_yPVRjBFS-I7hacMSBJ2MEaiUt1UaLWxbou8BOmmDdOhvFnO82Q9zLBRMlnqWavfxUzbwmOZ2_RTl4HwLyp3AL/s640/DataGrid_colspan.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
上述圖片還有一點美中不足的是序號列沒有跨列耶！！&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;5.最後一個動作，把序的rowspan改成2
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;e.Item.Cells[0].RowSpan = 2;//設定序號跨列的設定
&lt;/pre&gt;
&lt;br /&gt;
搞定！再來看一下完成圖！有沒有變得很賞心悅目呢！？
&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/AVvXsEiSX0lr7UPSiR_gjwsbr3Qx81hyxmGIBpbfHVUaoHQ2qvPcVLyeqOYGig8ZdosmPpfCEU1XwNfvSGooXW48-zipJbhtMI0ZPO-hgi4qefvIcmSf-sedBCBZdAGxu8iExNsHpDn58VK56uWl/s1600/DataGrid_span.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSX0lr7UPSiR_gjwsbr3Qx81hyxmGIBpbfHVUaoHQ2qvPcVLyeqOYGig8ZdosmPpfCEU1XwNfvSGooXW48-zipJbhtMI0ZPO-hgi4qefvIcmSf-sedBCBZdAGxu8iExNsHpDn58VK56uWl/s640/DataGrid_span.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2011/11/18 By YC
轉載請附上出處！</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/6777807819670368785/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/11/aspnet-rowspan-and-colspan-in-datagrid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/6777807819670368785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/6777807819670368785'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/11/aspnet-rowspan-and-colspan-in-datagrid.html' title='[ASP.net][C#] -DataGrid 巢狀顯示資料'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEiSX0lr7UPSiR_gjwsbr3Qx81hyxmGIBpbfHVUaoHQ2qvPcVLyeqOYGig8ZdosmPpfCEU1XwNfvSGooXW48-zipJbhtMI0ZPO-hgi4qefvIcmSf-sedBCBZdAGxu8iExNsHpDn58VK56uWl/s72-c/DataGrid_span.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-3650374751098673252</id><published>2011-10-30T11:36:00.000+08:00</published><updated>2012-01-27T23:14:11.869+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Html Agility Pack"/><category scheme="http://www.blogger.com/atom/ns#" term="Html Convert XML"/><category scheme="http://www.blogger.com/atom/ns#" term="Html Parser"/><category scheme="http://www.blogger.com/atom/ns#" term="Html2Xhtml"/><category scheme="http://www.blogger.com/atom/ns#" term="html解析"/><category scheme="http://www.blogger.com/atom/ns#" term="MarkupConverter"/><category scheme="http://www.blogger.com/atom/ns#" term="SGMLReader"/><category scheme="http://www.blogger.com/atom/ns#" term="Tidy"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><category scheme="http://www.blogger.com/atom/ns#" term="Xpath"/><title type='text'>[C#] - HTML轉成XML做Xpath</title><content type='html'>最近有一個需求是要做HTML的資料擷取，在以前是使用字串處理在運作，
&lt;br /&gt;
&lt;br /&gt;
後來運用正規式(Regular Expression)做分析擷取，不過有一個缺點就是維護不容易，
&lt;br /&gt;
&lt;br /&gt;
當原本要擷取的網頁異動時，便要全部重寫維護成本太高，
&lt;br /&gt;
&lt;br /&gt;
最近看了網路上的文章有人使用Xpath，才想到可以透過XML的特性去做分析擷取，
&lt;br /&gt;
&lt;br /&gt;
維護上也比較容易，不過要自己寫一個轉換的模組有些花時間，
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
既然自己想的到，浩瀚的網路一定有人做，
&lt;br /&gt;
&lt;br /&gt;
找了好幾款如：&lt;a href=&quot;http://htmlagilitypack.codeplex.com/&quot;&gt;Html Agility Pack&lt;/a&gt;、&lt;a href=&quot;http://www.it.uc3m.es/jaf/html2xhtml/&quot;&gt;Html2Xhtml&lt;/a&gt;、&lt;a href=&quot;http://tidy.sourceforge.net/&quot;&gt;Tidy&lt;/a&gt;、&lt;a href=&quot;http://code.msdn.microsoft.com/Converting-between-RTF-and-aaa02a6e/sourcecode?fileId=21412&amp;amp;pathId=100805561&quot;&gt;MarkupConverter&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
不過效果都不盡理想，就要放棄的時候...出現曙光&lt;a href=&quot;http://developer.mindtouch.com/SgmlReader&quot;&gt;SGMLReader&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
這是今天要介紹的，使用很簡單，
&lt;br /&gt;
&lt;br /&gt;
如下程式碼所示：
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;XmlDocument FromHtml(TextReader reader) {

    // setup SGMLReader
    Sgml.SgmlReader sgmlReader = new Sgml.SgmlReader();
    sgmlReader.DocType = &quot;HTML&quot;;
    sgmlReader.WhitespaceHandling = WhitespaceHandling.All;
    sgmlReader.CaseFolding = Sgml.CaseFolding.ToLower;
    sgmlReader.InputStream = reader;

    // create document
    XmlDocument doc = new XmlDocument();
    doc.PreserveWhitespace = true;
    doc.XmlResolver = null;
    doc.Load(sgmlReader);
    return doc;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
看一下做了Sample抓出來的資料，如下圖
&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/AVvXsEg7Oq8TCPWpRGYOq5wgP-ojKjSZ8Z7soL_Z5-5aeaZbKdzOnJW0waBFbZCr5XQyokxGVg8jor0ByUz13AiHwwdEpbLfTZ6-BIMnFkPRl7ag8saS1Y5_PF0SBearbHd5j9UniR3EehK8h4kX/s1600/Xpath2011.10.30.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Oq8TCPWpRGYOq5wgP-ojKjSZ8Z7soL_Z5-5aeaZbKdzOnJW0waBFbZCr5XQyokxGVg8jor0ByUz13AiHwwdEpbLfTZ6-BIMnFkPRl7ag8saS1Y5_PF0SBearbHd5j9UniR3EehK8h4kX/s640/Xpath2011.10.30.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
若真的想要自己做一個Dom的分析的話，可以參考Kelp的作品&lt;a href=&quot;http://kelp.phate.org/2011/10/c-html-mana-html-parser.html&quot;&gt;C# 分析 HTML 資料 - Mana Html Parser&lt;/a&gt;
&lt;br /&gt;
P.S.文章轉載請附上出處&lt;br /&gt;
&amp;lt;/br&amp;gt;&lt;br /&gt;
2011.10.29 By YC</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/3650374751098673252/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/c-convert-html-to-xml.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3650374751098673252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/3650374751098673252'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/c-convert-html-to-xml.html' title='[C#] - HTML轉成XML做Xpath'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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/AVvXsEg7Oq8TCPWpRGYOq5wgP-ojKjSZ8Z7soL_Z5-5aeaZbKdzOnJW0waBFbZCr5XQyokxGVg8jor0ByUz13AiHwwdEpbLfTZ6-BIMnFkPRl7ag8saS1Y5_PF0SBearbHd5j9UniR3EehK8h4kX/s72-c/Xpath2011.10.30.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7158527083456369396.post-6016196062107304067</id><published>2011-10-12T19:30:00.000+08:00</published><updated>2012-01-27T23:14:12.042+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="ModalPopupExtender"/><category scheme="http://www.blogger.com/atom/ns#" term="postback"/><title type='text'>[Asp.net] - Ajax ModalPopupExtender postback</title><content type='html'>&lt;br /&gt;
Ajax提供了不少好用的套件ModalPopupExtender是其中之一，&lt;br /&gt;
&lt;br /&gt;
ModalPopupExtender可以做出彈跳式視窗，不過也能做其他運用，&lt;br /&gt;
&lt;br /&gt;
譬如：在上面做查詢動作再選資料才關閉視窗，&lt;br /&gt;
&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
但是查詢動作時會牽涉到postback的動關係，&lt;br /&gt;
&lt;br /&gt;
而將畫面帶回原本的頁面，彈跳視窗就不見了，&lt;br /&gt;
&lt;br /&gt;
要怎麼去讓畫面繼續維持呢？&lt;br /&gt;
&lt;br /&gt;
其實不難....&lt;br /&gt;
&lt;br /&gt;
只要在執行的事件最後一行寫入&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;ModalPopupExtender1.Show();//設定ModalPopupExtender顯示&lt;/pre&gt;
&lt;br /&gt;
這樣就可以達到效果了。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/6016196062107304067/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/aspnet-ajax-modalpopupextender-postback.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/6016196062107304067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/6016196062107304067'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/aspnet-ajax-modalpopupextender-postback.html' title='[Asp.net] - Ajax ModalPopupExtender postback'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-1619034102976890829</id><published>2011-10-11T23:09:00.001+08:00</published><updated>2012-01-27T23:14:11.747+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Element"/><category scheme="http://www.blogger.com/atom/ns#" term="RegularExpression"/><category scheme="http://www.blogger.com/atom/ns#" term="RegularExpressionValidator"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>[Asp.net] - XML Element Valid</title><content type='html'>XML Element 可以自定義名稱很方便，不過還是有一些限制

以下是他的規則&lt;/br&gt;
&lt;blockquote&gt;
XML elements must follow these naming rules:&lt;/br&gt;
&lt;/br&gt;
1.Names can contain letters, numbers, and other characters&lt;/br&gt;
2.Names cannot start with a number or punctuation character&lt;/br&gt;
3.Names cannot start with the letters xml (or XML, or Xml, etc)&lt;/br&gt;
4.Names cannot contain spaces&lt;/blockquote&gt;&lt;/br&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

若是透過TextBox這類的控制項輸入Element時，就要做驗證了！&lt;/br&gt;&lt;/br&gt;

驗證的話可以寫一段javascript在寫入資料前做驗證&lt;/br&gt;&lt;/br&gt;

不過Asp.net提供類似的功能RegularExpressionValidator&lt;/br&gt;&lt;/br&gt;

可以針對某個控制項去做驗證&lt;/br&gt;&lt;/br&gt;

範例：&lt;/br&gt;

&lt;pre class=&quot;C#&quot; name=&quot;code&quot;&gt;
&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt;
&lt;asp:RegularExpressionValidator ID=&quot;RegularExpressionValidator1&quot;
  runat=&quot;server&quot; ErrorMessage=&quot;輸入的字串不適用於XML Element&quot; ValidationExpression=&quot;^(?!XML)(\D[.\S]*)&quot;
  ControlToValidate=&quot;TextBox1&quot; Display=&quot;Static&quot;&gt;
&lt;/asp:RegularExpressionValidator&gt;
&lt;/pre&gt;

&lt;/br&gt;


&lt;pre class=&quot;C#&quot; name=&quot;code&quot;&gt;
ValidationExpression=&quot;^(?!XML)(\D[.\S]*)&quot;
//這段是在做驗證用的
&lt;/pre&gt;
&lt;/br&gt;
RegularExpression寫的不太好&lt;/br&gt;&lt;/br&gt;

網路上有更多精準的pattern可以去套用!&lt;/br&gt;&lt;/br&gt;
&lt;/br&gt;&lt;/br&gt;
參考：&lt;/br&gt;
1.&lt;a href=&quot;http://stackoverflow.com/questions/2519845/how-to-check-if-string-is-a-valid-xml-element-name&quot;&gt;http://stackoverflow.com/questions/2519845/how-to-check-if-string-is-a-valid-xml-element-name&lt;/a&gt;&lt;/br&gt;
2.&lt;a href=&quot;http://yilinliu.blogspot.com/2010/07/aspnet-regularexpressionvalidator.html&quot;&gt;yilin 的程式日記&lt;/a&gt;





</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/1619034102976890829/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/aspnet-regularexpressionvalidator-xml.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/1619034102976890829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/1619034102976890829'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/aspnet-regularexpressionvalidator-xml.html' title='[Asp.net] - XML Element Valid'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-8002022598129734144</id><published>2011-10-05T23:40:00.001+08:00</published><updated>2012-01-27T23:14:12.331+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><title type='text'>[Asp.net][C#] - UpdatePanel focus 失效</title><content type='html'>UpdatePanel提供了一個局部更新的方案!&lt;br /&gt;
&lt;br /&gt;
但在UpdatePanel裡面的Control做Focus時，卻會失效！&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
原因是UpdatePanel postback後，無法去取得Control.Focus()&lt;br /&gt;&lt;br /&gt;
變通的方法是使用javacript來做focus動作!&lt;br /&gt;
&lt;pre class=&quot;brush: csharp;&quot;&gt;
        ScriptManager.RegisterStartupScript(updatepanel1, updatepanel1.GetType(), &quot;focus&quot;, &quot;setTimeout(\&quot;$get(&#39;&quot; +TextBox1.ClientID + &quot;&#39;).focus(); \&quot;, 100);&quot;, True);

&lt;/pre&gt;
&lt;br /&gt;
放在Page_Load的事件裡，一進入畫面就先註冊script&lt;br /&gt;&lt;br /&gt;

這樣就能達到同樣的效果囉!!&lt;br /&gt;&lt;br /&gt;

參考：&lt;br /&gt;
1.&lt;a href=&quot;http://www.codeproject.com/KB/ajax/AtlasUpdatepanelFocus.aspx&quot;&gt;http://www.codeproject.com/KB/ajax/AtlasUpdatepanelFocus.aspx&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://www.dotblogs.com.tw/jeff377/archive/2008/03/17/1717.aspx&quot;&gt;設定 UpdatePanel 中控制項的 focus&lt;/a&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/8002022598129734144/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/aspnet-updatepanel-focus-invalid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8002022598129734144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/8002022598129734144'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/aspnet-updatepanel-focus-invalid.html' title='[Asp.net][C#] - UpdatePanel focus 失效'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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-7158527083456369396.post-5073762442551821376</id><published>2011-10-01T14:06:00.001+08:00</published><updated>2012-01-27T23:14:11.982+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="LavaLamp"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><title type='text'>[jQuery] - LavaLamp 效果</title><content type='html'>最近迷上了jQuery絢麗的效果!&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
找了幾個好玩的特效來練習，LavaLamp 是一個滑動的menu特效&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;iframe height=&quot;100&quot; src=&quot;http://nixboxdesigns.com/projects/jquery-lavalamp/demos/example10.html&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;

要做到上述的動作怎麼辦到呢!?&lt;br /&gt;
&lt;br /&gt;
其實不難，重點在透過活用CSS的配置!!&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;接下來大致講解一下使用方法!
&lt;br /&gt;
&lt;br /&gt;
1.載入js(廢話)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.lavalamp-1.3.5.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
P.S.可以再加入easying.js，這樣就會有上面的反彈效果！&lt;br /&gt;
2.初始化lavaLamp並做參數設定!&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;javascript&quot; name=&quot;code&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
$(function() {$(&#39;&#39;ul#menu&#39;&#39;).lavaLamp();
});&amp;lt;/script&amp;gt;&lt;/pre&gt;
3.寫CSS

&lt;br /&gt;
&lt;pre class=&quot;css&quot; name=&quot;code&quot;&gt;&amp;lt;style type=&quot;text/css&quot;&amp;gt;
div#menu {
	list-style:none;
	margin:5px;
	border:1px solid #333;
	padding:10px;
	overflow:auto; /* makes sure the container fits the floated list-items below */
	background-color:#ccc; /* moved and lightened the background color from div#menu li */
}
div#menu nav{
	margin:3px 5px;
	padding:8px 20px 9px 18px;
	float:left;
	font-family:Tahoma, Verdana, Arial, sans-serif;
	font-size:18px;
	font-weight:bold;
	font-style:italic;
	text-shadow: rgba(255,255,255, 1) 1px 1px 2px;
	color:#333;
}
div#menu nav a {
	position: relative;
	z-index: 5;
	color:#333;
	text-decoration:none;
}
div#menu nav a:hover {
	color:#FFF;
}
div#menu nav.backLava {
	position:absolute;
	z-index:3;
	background:url(images/bg-oranger.jpg) no-repeat top left;
	border:2px solid brown;
	-webkit-border-radius: 10px; 
	-moz-border-radius: 10px;  
	border-radius: 10px;
	box-shadow: 2px 2px 3px #000;
	-webkit-box-shadow: 2px 2px 3px #000;
	-moz-box-shadow: 2px 2px 3px #000;
}
&amp;lt;/style&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
好不容易寫完了，可以來看一下特效了！&lt;br /&gt;
P.S.若click動作沒有work的話，就要調整z-index這個參數，&lt;br /&gt;因為卡在圖層的關係！把你要click的圖層往上調整就可以使用這個炫麗的特效了!&lt;br /&gt;
參考：&lt;br /&gt;
1.&lt;a href=&quot;http://nixboxdesigns.com/projects/jquery-lavalamp/&quot;&gt;Nixbox Designs&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://plugins.jquery.com/project/lavalamp2&quot;&gt;lavalamp2&lt;/a&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://yanchi-huang.blogspot.com/feeds/5073762442551821376/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/jquery-lavalamp-plugin.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/5073762442551821376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7158527083456369396/posts/default/5073762442551821376'/><link rel='alternate' type='text/html' href='http://yanchi-huang.blogspot.com/2011/10/jquery-lavalamp-plugin.html' title='[jQuery] - LavaLamp 效果'/><author><name>YC&#39;s knowledge Management</name><uri>http://www.blogger.com/profile/11780735643478438006</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>