<?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-1733122650600186410</id><updated>2024-09-10T15:16:00.116+08:00</updated><category term="C# 基礎"/><category term="C# 問題"/><category term="Big5"/><category term="C# 基礎：陣列"/><category term="C#: Image"/><category term="DotNet Core 5"/><category term="DotNet Framework"/><category term="Encoding"/><category term="Excel"/><category term="Extension Method"/><category term="String.Format"/><category term="delegate"/><category term="enum"/><category term="flag"/><category term="中文正體字"/><category term="亂碼"/><category term="列印"/><category term="數值"/><title type='text'>C# 筆記</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1733122650600186410.post-230471431368097551</id><published>2022-06-01T14:09:00.000+08:00</published><updated>2022-06-01T14:09:02.447+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 問題"/><category scheme="http://www.blogger.com/atom/ns#" term="Excel"/><category scheme="http://www.blogger.com/atom/ns#" term="列印"/><title type='text'>用 Interop.Excel 列印檔案，居然說 &quot;找不到檔案&quot; ?</title><content type='html'>&lt;p&gt;在一個專案裡，套用 Excel 模板，把數據填進去之後，把該檔案列印出來。在列印的時候跳出&lt;/p&gt;&lt;p&gt;&quot;很抱歉, 我們找不到 xxx。此項目是否已移動，重新命名或刪除?&quot;&lt;/p&gt;&lt;p&gt;經檢查，檔案也確實有在那邊啊。Google 很久也找不到答案。最後嘗試&lt;/p&gt;&lt;blockquote&gt;string filename = Path.GetFullPath(file);&lt;/blockquote&gt;&lt;p&gt;終於，問題解決了，原來原本提供的是相對路徑，而 Excel 要的是檔案的絕對路徑。&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/230471431368097551/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/230471431368097551' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/230471431368097551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/230471431368097551'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2022/06/interopexcel.html' title='用 Interop.Excel 列印檔案，居然說 &quot;找不到檔案&quot; ?'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-5357502070955735104</id><published>2022-03-10T08:33:00.000+08:00</published><updated>2022-03-10T08:33:02.616+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Big5"/><category scheme="http://www.blogger.com/atom/ns#" term="C# 問題"/><category scheme="http://www.blogger.com/atom/ns#" term="Encoding"/><category scheme="http://www.blogger.com/atom/ns#" term="中文正體字"/><category scheme="http://www.blogger.com/atom/ns#" term="亂碼"/><title type='text'>Encoding.GetEncoding(&quot;BIG5&quot;) 取得中文正體字編碼</title><content type='html'>&lt;p&gt;以 C# 程式撰寫讀取內容為中文正體字檔案的程式時，出現中文正體字都變成亂碼&lt;span style=&quot;font-family: &amp;quot;Liberation Serif&amp;quot;, serif;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Liberation Serif&amp;quot;, serif;&quot;&gt;網路爬文後說是要用 NuGet 安裝&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Liberation Serif, serif;&quot;&gt;System.Text.Encoding.CodePages 的套件&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Liberation Serif&amp;quot;, serif;&quot;&gt;。然後可以用下面指令取得編碼&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Liberation Serif&amp;quot;, serif;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Liberation Serif, serif;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: Liberation Serif, serif;&quot;&gt;Encoding encoding = Encoding.GetEncoding(950);&lt;/span&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style=&quot;font-family: Liberation Serif, serif;&quot;&gt;&amp;nbsp;在這之前，還有一件很重要的事情，就是要用下面的指令註冊，不然程式在執行時還是會出錯。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: Liberation Serif, serif;&quot;&gt;Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);&lt;/span&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Liberation Serif, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/5357502070955735104/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/5357502070955735104' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/5357502070955735104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/5357502070955735104'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2022/03/encodinggetencodingbig5.html' title='Encoding.GetEncoding(&quot;BIG5&quot;) 取得中文正體字編碼'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-2852418642377245795</id><published>2021-10-16T11:00:00.004+08:00</published><updated>2021-10-16T11:00:50.407+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DotNet Core 5"/><category scheme="http://www.blogger.com/atom/ns#" term="DotNet Framework"/><title type='text'>從 DotNet Framework App 使用 DotNet Core 5 開發的程式庫</title><content type='html'>&lt;p&gt;若想要將以 DotNet Core 5 開發的程式庫，可以讓 DotNet Framework 使用，須將 &quot;xxxx.csproj&quot; 檔案內的&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&amp;lt;TargetFramework&amp;gt;net5.0&amp;lt;/TargetFramework&amp;gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;改為&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&amp;lt;TargetFrameworks&amp;gt;net5.0;netstandard2.0&amp;lt;/TargetFrameworks&amp;gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/2852418642377245795/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/2852418642377245795' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2852418642377245795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2852418642377245795'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2021/10/dotnet-framework-app-dotnet-core-5.html' title='從 DotNet Framework App 使用 DotNet Core 5 開發的程式庫'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-1757505218190237305</id><published>2021-10-06T08:48:00.001+08:00</published><updated>2021-10-06T08:48:58.997+08:00</updated><title type='text'>無法載入檔案或組件…</title><content type='html'>&lt;p&gt;最近開發的一個 C# 程式在 Debug 模式時，可以正確運行，但在 Release 模式時，安裝到標的主機後，運行時卻出現下面錯誤訊息。&lt;/p&gt;&lt;p&gt;Could not load file or assembly &#39;...&#39; or one of its dependencies. The located assembly&#39;s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)&lt;/p&gt;&lt;p&gt;Google 到的答案都說是程式庫版本的問題，但我檢查過兩種模式下的程式庫版本是一致的。&lt;/p&gt;&lt;p&gt;最後將 &quot;&lt;span style=&quot;font-family: &amp;quot;Liberation Serif&amp;quot;, serif;&quot;&gt;XXX.exe.config&lt;/span&gt;&quot; 的檔案一起打包安裝到標的主機就解決了。&lt;/p&gt;&lt;p&gt;附註：我是用 Inno Setup 進行程式的打包安裝。以前沒有將 &quot;&lt;span style=&quot;font-family: &amp;quot;Liberation Serif&amp;quot;, serif;&quot;&gt;XXX.exe.config&lt;/span&gt;&quot; 打包安裝也不曾出現這種問題。&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/1757505218190237305/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/1757505218190237305' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/1757505218190237305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/1757505218190237305'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2021/10/blog-post.html' title='無法載入檔案或組件…'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-7780716549814501117</id><published>2019-02-09T10:28:00.001+08:00</published><updated>2019-02-09T10:37:13.681+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎"/><category scheme="http://www.blogger.com/atom/ns#" term="Extension Method"/><title type='text'>C#  Extension Method 的基本格式</title><content type='html'>假設要為 class MyClass 撰寫一個 CheckValue 的 Extension Method ，輸入的參數為 ClassName2，回傳類別為 ReturnType，其寫法如下：&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public static class&lt;/span&gt; MyClassExtensions&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;public static&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt; ReturnType CheckValue&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;(this&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt; MyClass arg1, ClassName2 arg2&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;ReturnType result;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;/* Your code */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;return result;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;　　　　&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
根據實際情形可以沒有輸入參數，Return Type 也可以為 void．</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/7780716549814501117/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/7780716549814501117' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/7780716549814501117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/7780716549814501117'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2019/02/c-extension-method-template.html' title='C#  Extension Method 的基本格式'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-2897779387089180220</id><published>2018-07-16T07:20:00.002+08:00</published><updated>2018-07-16T07:20:22.381+08:00</updated><title type='text'>C# operator overload</title><content type='html'>&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;假設 operator overload 的對象是 class T&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static T operator + (T x, T y){}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static T operator - (T x, T y){}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static T operator * (T x, T y){}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static T operator / (T x, T y){}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static bool operator == (T x, T y){}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static bool operator != (T x, T y){ return !(x == y);}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public override bool Equals(object obj){ return this == (T)obj;}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public override int GetHashCode(){ }&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static bool operator &amp;gt; (T x, T y){ }&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static bool operator &amp;lt; (T x, T y){}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static bool operator &amp;gt;= (T x, T y){ return (x &amp;gt; y) || (x == y);}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;public static bool operator &amp;lt;= (T x, T y){ return (x &amp;lt; y) || (x == y);}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/2897779387089180220/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/2897779387089180220' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2897779387089180220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2897779387089180220'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2018/07/c-operator-overload.html' title='C# operator overload'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-2017304283959162791</id><published>2018-07-12T19:03:00.000+08:00</published><updated>2018-07-12T19:03:04.427+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎"/><category scheme="http://www.blogger.com/atom/ns#" term="enum"/><category scheme="http://www.blogger.com/atom/ns#" term="flag"/><title type='text'>C#: Enum as Flag</title><content type='html'>&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;在 Code Project 看到將 enum 當旗標 (flag) 使用的方法&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot; /&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;
[Flags]&lt;br /&gt;enum DaysOfTheWeek&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; Sunday = 1,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Monday = 1 &amp;lt;&amp;lt; 1,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Tuesday = 1 &amp;lt;&amp;lt; 2,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Wednesday = 1 &amp;lt;&amp;lt; 3,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Thursday = 1 &amp;lt;&amp;lt; 4,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Friday = 1 &amp;lt;&amp;lt; 5,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Saturday = 1 &amp;lt;&amp;lt; 6,&lt;br /&gt;}&lt;/blockquote&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;如果不使用位元移位運算元的話，數值必須要自己算出如下：&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;
[Flags]&lt;br /&gt;enum DaysOfTheWeek&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; Sunday = 1,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Monday = 2,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Tuesday = 4,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Wednesday = 8,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Thursday = 16,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Friday = 32,&lt;br /&gt;&amp;nbsp; &amp;nbsp; Saturday = 64&lt;br /&gt;}&lt;/blockquote&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;原文 &quot;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/396851/Ending-the-Great-Debate-on-Enum-Flags&quot; style=&quot;background-color: white; color: #009eb8; display: inline; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; outline: none; text-align: justify; text-decoration-line: none; transition: color 0.3s;&quot;&gt;Ending the Great Debate on Enum Flags&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;&quot;。&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/2017304283959162791/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/2017304283959162791' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2017304283959162791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2017304283959162791'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2018/07/c-enum-as-flag.html' title='C#: Enum as Flag'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-3763632953422758860</id><published>2017-11-17T21:29:00.001+08:00</published><updated>2017-11-17T21:29:32.183+08:00</updated><title type='text'>將 C# enum 加到 ComboBox</title><content type='html'>現有已定義的 enum 如下:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;
enum Races{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Human = 1,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Dwarf,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Elf,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Orc,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Goblin,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Vampire,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Centaur&lt;br /&gt;
}&lt;/span&gt;
&lt;/blockquote&gt;
可用下面的 Code 將 enum 裡的項目加到 ComboBox&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;
void AddEnumToComboBox(ComboBox box){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;box.Items.Clear();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;foreach(Races item in Enum.GetValues(typeof(Races))){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;box.Items.Add(item);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;/span&gt;&lt;/blockquote&gt;
在 ComboBox SelectedIndexChanged 函數內&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;
void comboBox_SelectedIndexChanged(object sender, EventArgs e){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;int index = this.comboBox.SelectedIndex;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Races race = (Races)this.comboBox.SelectedItem;&lt;br /&gt;
}&lt;/span&gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/3763632953422758860/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/3763632953422758860' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/3763632953422758860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/3763632953422758860'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2017/11/c-enum-combobox.html' title='將 C# enum 加到 ComboBox'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-4657003684198418109</id><published>2016-07-14T15:55:00.000+08:00</published><updated>2016-07-14T15:55:35.236+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎"/><category scheme="http://www.blogger.com/atom/ns#" term="delegate"/><title type='text'>C# delegate 的使用範例</title><content type='html'>&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;public class ClassNeedsDelegate&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //宣告&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate int DelegateFun(int parameter1, int parameter2);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #region Fields&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DelegateFun delgFun = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #endregion&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #region Properties&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public DelegateFun DelgFun&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get { return delgFun; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set { delgFun = value; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #endregion&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #region Public Methods&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int DelegateCaller(int p1, int p2)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (delgFun != null)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return delgFun(p1, p2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #endregion&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
用法：&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;class Program&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int a = 3;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int b = 5;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ClassNeedsDelegate testClass = new ClassNeedsDelegate();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; testClass.DelgFun = TestDelegate1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int result = testClass.DelegateCaller(a, b);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(string.Format(&quot;delegate 1: {0}&quot;, result));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; testClass.DelgFun = TestDelegate2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result = testClass.DelegateCaller(a, b);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(string.Format(&quot;delegate 2: {0}&quot;, result));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;=== THE END ===&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.ReadKey();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static int TestDelegate1(int a, int b)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return a + b;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static int TestDelegate2(int a, int b)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return a * b;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/4657003684198418109/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/4657003684198418109' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/4657003684198418109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/4657003684198418109'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2016/07/c-delegate.html' title='C# delegate 的使用範例'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-7542886443531363634</id><published>2009-03-27T11:00:00.003+08:00</published><updated>2012-06-27T13:01:02.702+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="String.Format"/><category scheme="http://www.blogger.com/atom/ns#" term="數值"/><title type='text'>C# String 用在數值的 Format 語法</title><content type='html'>&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;一般&lt;/td&gt;&lt;td&gt;G 或 g&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:G}&quot;, 2.5);&lt;/td&gt;&lt;td&gt;2.5&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;固定點&lt;/td&gt;&lt;td&gt;F 或 f&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:F2}&quot;, 25);&lt;/td&gt;&lt;td&gt;25.00&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;科學記號&lt;/td&gt;&lt;td&gt;E 或 e&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:E}&quot;, 250000);&lt;/td&gt;&lt;td&gt;2.500000E+005&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;十進位&lt;/td&gt;&lt;td&gt;D 或 d&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:D5}&quot;, 25);&lt;/td&gt;&lt;td&gt;00025&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;十六進位&lt;/td&gt;&lt;td&gt;X 或 x&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:X}&quot;, 250);&lt;/td&gt;&lt;td&gt;FA&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;數值&lt;/td&gt;&lt;td&gt;N 或 n&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:N}&quot;, 2500000);&lt;/td&gt;&lt;td&gt;2,500,000.00&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;貨幣&lt;/td&gt;&lt;td&gt;C 或 c&lt;/td&gt;&lt;td&gt;string.Format(&quot;{0:C}&quot;, 2.5);&lt;/td&gt;&lt;td&gt;$2.50&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/7542886443531363634/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/7542886443531363634' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/7542886443531363634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/7542886443531363634'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2009/03/c-string-format.html' title='C# String 用在數值的 Format 語法'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-6218762082748174411</id><published>2008-05-22T13:10:00.002+08:00</published><updated>2008-05-22T13:40:08.250+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#: Image"/><title type='text'>Zoom Image in C#</title><content type='html'>將一個在 pictureBoxSource的 Image，在點擊 Zoom的按鈕之後，被Zoom的部分會被放到pictureBoxDestination去．&lt;br /&gt;&lt;br /&gt;首先需要知道要Zoom in 的Image 的位置與大小．這些資訊由 Mouse的事件來蒐集．&lt;br /&gt;&lt;blockquote style=&quot;font-family: verdana; font-size: 85%;&quot;&gt;&lt;br /&gt;Rectangle dragWindowSave = Rectangle.Empty;&lt;br /&gt;Point dragStart = Point.Empty;&lt;br /&gt;Point dragEnd = Point.Empty;&lt;br /&gt;     &lt;br /&gt;void PictureBoxSourceMouseDown(object sender, MouseEventArgs e)&lt;br /&gt;{&lt;br /&gt;   this.dragEnd = Point.Empty;&lt;br /&gt;   this.dragStart = new Point(e.X, e.Y);&lt;br /&gt;}&lt;br /&gt;     &lt;br /&gt;void PictureBoxSourceMouseMove(object sender, MouseEventArgs e)&lt;br /&gt;{&lt;br /&gt;   if(this.dragStart != this.dragEnd)&lt;br /&gt;       this.dragWindow = this.GenerateRectangle(this.dragStart, new Point(e.X, e.Y));&lt;br /&gt;   this.pictureBoxSource.Refresh();&lt;br /&gt;}&lt;br /&gt;     &lt;br /&gt;void PictureBoxSourceMouseUp(object sender, MouseEventArgs e)&lt;br /&gt;{&lt;br /&gt;   this.dragEnd = e.Location;&lt;br /&gt;   this.dragWindowSave = this.dragWindow;&lt;br /&gt;   this.dragStart = Point.Empty;&lt;br /&gt;   this.dragEnd = Point.Empty;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;要被Zoom的資訊暫存在dragWindowSave．接著是做Zoom的動作．&lt;br /&gt;&lt;blockquote style=&quot;font-family: verdana; font-size: 85%;&quot;&gt;&lt;br /&gt;void ButtonZoomClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    int w = this.dragWindowSave.Width;&lt;br /&gt;    int h = this.dragWindowSave.Height;&lt;br /&gt;   &lt;br /&gt;    int newH = h * this.pictureBoxDestination.Width / w;&lt;br /&gt;    if(newH &amp;lt this.pictureBoxDestination.Height)&lt;br /&gt;    {&lt;br /&gt;        w = this.pictureBoxDestination.Width;&lt;br /&gt;        h = newH;&lt;br /&gt;    }&lt;br /&gt;    int newW = w * this.pictureBoxDestination.Height / h;&lt;br /&gt;    if(newW &amp;lt this.pictureBoxDestination.Width)&lt;br /&gt;    {&lt;br /&gt;        w = newW;&lt;br /&gt;        h = this.pictureBoxDestination.Height;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    this.pictureBoxDestination.Image = new Bitmap(w, h);&lt;br /&gt;    using(Graphics g = Graphics.FromImage(this.pictureBoxDestination.Image))&lt;br /&gt;    {&lt;br /&gt;        Rectangle srceRect = new Rectangle(this.dragWindowSave.Location, this.dragWindowSave.Size);&lt;br /&gt;        Rectangle destRect = new Rectangle(0, 0, this.pictureBoxDestination.Image.Width, this.pictureBoxDestination.Image.Height);&lt;br /&gt;        g.DrawImage(this.pictureBoxSource.Image, destRect, srceRect, GraphicsUnit.Pixel);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;在 Paint的事件函數，我們追蹤要被Zoom的區塊：&lt;br /&gt;&lt;blockquote style=&quot;font-family: verdana; font-size: 85%;&quot;&gt;&lt;br /&gt;void PictureBoxSourcePaint(object sender, PaintEventArgs e)&lt;br /&gt;{&lt;br /&gt;   this.DrawDragWindow(e.Graphics);&lt;br /&gt;}&lt;br /&gt;void DrawDragWindow(Graphics g)&lt;br /&gt;{&lt;br /&gt;   if(this.dragWindow != Rectangle.Empty)&lt;br /&gt;       g.DrawRectangle(new Pen(Color.Orange), this.dragWindow);&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;其他輔助函數：&lt;br /&gt;&lt;blockquote style=&quot;font-family: verdana; font-size: 85%;&quot;&gt;&lt;br /&gt;private Rectangle GenerateRectangle(Point a, Point b)&lt;br /&gt;{&lt;br /&gt;   Point topLeft = new Point();&lt;br /&gt;   topLeft.X = Math.Min(a.X, b.X);&lt;br /&gt;   topLeft.Y = Math.Min(a.Y, b.Y);&lt;br /&gt;   int width = Math.Abs(a.X - b.X);&lt;br /&gt;   int height = Math.Abs(a.Y - b.Y);&lt;br /&gt;   return new Rectangle(topLeft, new Size(width, height));&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/6218762082748174411/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/6218762082748174411' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/6218762082748174411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/6218762082748174411'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2008/05/zoom-image-in-c.html' title='Zoom Image in C#'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-696204114306414716</id><published>2008-01-11T11:08:00.000+08:00</published><updated>2008-01-11T11:21:17.512+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 問題"/><title type='text'>在C#中使用VB6所製作的DLL檔</title><content type='html'>VB6所製作的DLL檔是屬於 &quot;&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;a name=&quot;more&quot;&gt;Unmanaged&lt;/a&gt;&lt;a name=&quot;more&quot;&gt; Code&lt;/a&gt;&quot;．而C#所使用的是屬於 &quot;&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;a name=&quot;more&quot;&gt;Managed Code&lt;/a&gt;&quot;．因此我們必須將 &quot;&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;a name=&quot;more&quot;&gt;Unmanaged&lt;/a&gt;&lt;a name=&quot;more&quot;&gt; Code&lt;/a&gt;&quot;轉換成 &quot;&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;a name=&quot;more&quot;&gt;Managed Code&lt;/a&gt;&quot;．&lt;br /&gt;步驟1.&lt;br /&gt;將該欲轉換的DLL檔複製到tlbimp&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;&lt;/span&gt;&lt;/span&gt;.exe的所在位置，預設是在 &quot;C:\Program Files\Microsoft.NET\SDK\v2.0\Bin&quot;&lt;br /&gt;步驟2.&lt;br /&gt;從 &quot;附屬應用程式&quot; 啟動 &quot;命令提示字元&quot;。在視窗開啟之後，變更目錄到tlbimp&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;&lt;/span&gt;&lt;/span&gt;.exe的所在位置。&lt;br /&gt;cd C:\Program  Files\Microsoft.NET\SDK\v2.0\Bin&lt;br /&gt;步驟3.&lt;br /&gt;執行&lt;br /&gt;c:tlbimp&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt; 原始.DLL /o:目的.DLL&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;執行完成之後會產生&quot;&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;目的.DLL&quot;&lt;/span&gt;&lt;/span&gt;檔。將這個DLL檔複製到專案的目錄下。&lt;br /&gt;步驟4:&lt;br /&gt;在C#內，以 Add Reference \ .NET Assembly Browser 將DLL檔引入 ，並在檔案的最上方加入&lt;br /&gt;using 剛加入&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;DLL&lt;/span&gt;&lt;/span&gt;的&lt;span class=&quot;bodycopy&quot;&gt;&lt;span class=&quot;bodycopy&quot;&gt;name space；&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/696204114306414716/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/696204114306414716' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/696204114306414716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/696204114306414716'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2008/01/cvb6dll.html' title='在C#中使用VB6所製作的DLL檔'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-2350048516765936333</id><published>2007-12-28T10:10:00.000+08:00</published><updated>2007-12-28T10:26:02.370+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎：陣列"/><title type='text'>Array 的宣告與維度</title><content type='html'>C#的陣列(Array)有兩種，宣告方式分別如下：&lt;br /&gt;&lt;blockquote&gt;Type [][][] Array1;&lt;br /&gt;Type [,,] Array2;&lt;/blockquote&gt;舉例來說：&lt;br /&gt;&lt;blockquote&gt;double [][][] Array1 = new double [3][][];&lt;br /&gt;for(int i=0; i&lt;3; j=&quot;0;&quot;&gt;要知道其各維度的長度，需用下面的方法：&lt;br /&gt;&lt;blockquote&gt;Array1.Length; // = 3&lt;br /&gt;Array1[0].Length; // = 4&lt;br /&gt;Array1[0][0].Length; // = 5&lt;/blockquote&gt;對於第二種：&lt;br /&gt;&lt;blockquote&gt;double [, , ] Array2 = new double [3, 4, 5];&lt;/blockquote&gt;要知道其各維度的長度，需用下面的方法：&lt;br /&gt;&lt;blockquote&gt;Array2.GetLength(0); // 3&lt;br /&gt;Array2.Getength(1); // 4&lt;br /&gt;Array2.GetLength(2); // 5&lt;/blockquote&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/2350048516765936333/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/2350048516765936333' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2350048516765936333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2350048516765936333'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2007/12/array.html' title='Array 的宣告與維度'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-5937796519215962146</id><published>2007-11-29T08:22:00.000+08:00</published><updated>2007-11-29T08:55:56.616+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 問題"/><title type='text'>在C#中使用OCX檔</title><content type='html'>問題：&lt;br /&gt;有一系統開發案要使用到DAQ板，根據文件說明，可利用所提供的Active X程式庫來控制該板子，而此程式庫是OCX檔案。該文件也宣稱支援VB，VC++，以及C#，但是在C#內，以 Add Reference \ COM 將該OCX檔引入，會出現 &quot;Warning MSB3287: Cannot load type fibrary for reference .... 程式庫未登錄&quot;。&lt;br /&gt;解決方法：&lt;br /&gt;步驟1:&lt;br /&gt;將該 OCX 檔複製到AxImp.exe的所在位置，預設是在 &quot;C:\Program Files\Microsoft.NET\SDK\v2.0\Bin&quot;&lt;br /&gt;步驟2:&lt;br /&gt;從 &quot;附屬應用程式&quot; 啟動 &quot;命令提示字元&quot;。在視窗開啟之後，變更目錄到AxImp.exe的所在位置。&lt;br /&gt;cd C:\Program Files\Microsoft.NET\SDK\v2.0\Bin&lt;br /&gt;步驟3:&lt;br /&gt;執行 &quot;AxImp filename.ocx&quot;，其中filename.ocx是複製過去的檔案。執行完成之後會產生兩個DLL檔，即AxfilenameLib.dll 及filenameLib.dll。將這兩個DLL檔複製到專案的目錄下。&lt;br /&gt;步驟4:&lt;br /&gt;在C#內，以 Add Reference \ .NET Assembly Browser 將兩個DLL檔引入，然後在 Design 視窗的工具列就可以看到新增加的&quot;控制項&quot;。&lt;br /&gt;&lt;br /&gt;以上複製檔案是為了避免程式執行環境的設定。</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/5937796519215962146/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/5937796519215962146' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/5937796519215962146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/5937796519215962146'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2007/11/cocx.html' title='在C#中使用OCX檔'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-2200287726841417694</id><published>2007-11-28T18:00:00.000+08:00</published><updated>2007-11-28T18:13:45.816+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎"/><title type='text'>程式流程控制</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;if 敘述&lt;/span&gt;&lt;br /&gt;&lt;blockquote style=&quot;font-family: courier new;&quot;&gt;if(判斷式){}&lt;br /&gt;&lt;br /&gt;if(判斷式){}&lt;br /&gt;else{}&lt;br /&gt;&lt;br /&gt;if(判斷式){}&lt;br /&gt;else if(判斷式){}&lt;br /&gt;else{}&lt;br /&gt;&lt;br /&gt;(判斷式)?(判斷為真後執行的部分):(判斷為偽後執行的部分);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;switch敘述&lt;/span&gt;&lt;br /&gt;&lt;blockquote style=&quot;font-family: courier new;&quot;&gt;switch(判斷式)&lt;br /&gt;{&lt;br /&gt;    case 條件1:&lt;br /&gt;    {&lt;br /&gt;        break;&lt;br /&gt;        }&lt;br /&gt;    case 條件2:&lt;br /&gt;       {&lt;br /&gt;        break;&lt;br /&gt;    }&lt;br /&gt;    default:&lt;br /&gt;    {&lt;br /&gt;        break;&lt;br /&gt;    }&lt;br /&gt;}&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/2200287726841417694/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/2200287726841417694' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2200287726841417694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/2200287726841417694'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2007/11/blog-post_28.html' title='程式流程控制'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-4745901001904274668</id><published>2007-11-23T23:42:00.000+08:00</published><updated>2007-11-23T23:55:58.521+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎"/><title type='text'>程式進入點</title><content type='html'>C#程式的進入點是稱做 Main 的函數，有四種形式：&lt;br /&gt;&lt;span style=&quot;font-family: courier new;font-family:Times New Roman, serif;&quot; &gt;static void Main() {...}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier new;font-family:Times New Roman, serif;&quot; &gt;static int Main() {...}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier new;font-family:Times New Roman, serif;&quot; &gt;static void Main(string[] args) {...}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier new;font-family:Times New Roman, serif;&quot; &gt;static int Main(string[] args) {...}&lt;/span&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt; &lt;/span&gt;&lt;br /&gt;其中，第一與第二種形式，無傳入參數；而第三與第四種則有傳入參數&lt;span style=&quot;font-family:新細明體, serif;&quot;&gt;。&lt;/span&gt; 這個傳入參數就是命列裡的參數，例如：在DOS環境下&lt;br /&gt;C:\copy file_a file_b&lt;br /&gt;file_a與file_b就是傳入參數，可從args[0]，以及args[1]分別取得&lt;span style=&quot;font-family:新細明體, serif;&quot;&gt;。&lt;br /&gt;&lt;/span&gt;另外，第一與第三種形式的回傳宣告為 void，也就是沒有回傳值；而第二與第四種形式的回傳宣告為 int，所以函數必須回傳(return)一個整數值&lt;span style=&quot;font-family:新細明體, serif;&quot;&gt;。&lt;/span&gt;一般來說，若函數執行沒有發生錯誤，會回傳0，代表函數執行成功；否則回傳非0的值&lt;span style=&quot;font-family:新細明體, serif;&quot;&gt;。&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/4745901001904274668/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/4745901001904274668' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/4745901001904274668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/4745901001904274668'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2007/11/blog-post_23.html' title='程式進入點'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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-1733122650600186410.post-1286143677354952748</id><published>2007-11-21T22:05:00.000+08:00</published><updated>2007-11-21T22:25:02.133+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# 基礎"/><title type='text'>變數類型</title><content type='html'>&lt;p style=&quot;margin-bottom: 0cm; color: rgb(0, 153, 0);&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;table style=&quot;color: rgb(0, 153, 0);&quot; border=&quot;1&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt;  &lt;col width=&quot;40*&quot;&gt;  &lt;col width=&quot;59*&quot;&gt;  &lt;col width=&quot;19*&quot;&gt;  &lt;col width=&quot;139*&quot;&gt;  &lt;tbody&gt;&lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Arial,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;簡寫&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Arial,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;原型&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Arial,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Byte&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Arial,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;範圍&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;char&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Char&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Unicode    character&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;sbyte&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.SByte&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;-128 .. 127&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;byte&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Byte&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;0 .. 255&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;short&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Int16&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;-32768 ..    32767&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;ushort&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.UInt16&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;0 .. 65535&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Int32&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;-2147483648 ..    2147483647&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;uint&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.UInt32&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;0 ..    4294967295&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;long&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Int64&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;-2&lt;sup&gt;63&lt;/sup&gt;..    2&lt;sup&gt;63&lt;/sup&gt;-1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;ulong&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.UInt64&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;0 .. 2&lt;sup&gt;64&lt;/sup&gt;-1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;float&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Single&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;±1.5E-45    .. ±3.4E38 (32 Bit)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;double&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Double&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;±5E-324    .. ±1.7E308 (64 Bit)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;decimal&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Decimal&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;±1E-28    .. ±7.9E28 (128 Bit)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr valign=&quot;top&quot;&gt;   &lt;td width=&quot;16%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;bool&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;23%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;System.Boolean&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;7%&quot;&gt;    &lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width=&quot;54%&quot;&gt;    &lt;p&gt;&lt;span style=&quot;font-family:Courier New,monospace;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;true, false&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p style=&quot;margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmemo.blogspot.com/feeds/1286143677354952748/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1733122650600186410/1286143677354952748' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/1286143677354952748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1733122650600186410/posts/default/1286143677354952748'/><link rel='alternate' type='text/html' href='http://csharpmemo.blogspot.com/2007/11/blog-post.html' title='變數類型'/><author><name>Edward</name><uri>http://www.blogger.com/profile/02740271012450756080</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>