<?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:gd="http://schemas.google.com/g/2005"><id>tag:blogger.com,1999:blog-4500363753981919783.post632975496229938580..comments</id><updated>2023-10-03T22:06:50.708+08:00</updated><title type='text'>Comments on Huan-Lin 學習筆記: 我的 Visual C# 2010 按鍵速查表</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.huanlintalk.com/feeds/comments/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html'/><link rel="hub" href="http://pubsubhubbub.appspot.com/"/><author><name>Michael Tsai</name><uri>http://www.blogger.com/profile/00364693770445538641</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>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-3513192278971611333</id><published>2010-10-18T03:44:43.786+08:00</published><updated>2010-10-18T03:44:43.786+08:00</updated><title type='text'>由於留言回覆的內容太長,超過 Blogspot 允許儲存的字數限制,所以我用單獨一篇文章回覆你囉! ...</title><content type='html'>由於留言回覆的內容太長,超過 Blogspot 允許儲存的字數限制,所以我用單獨一篇文章回覆你囉! 網址是:&lt;br /&gt;http://huan-lin.blogspot.com/2010/10/reply-about-params-array.html</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/3513192278971611333'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/3513192278971611333'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html?showComment=1287344683786#c3513192278971611333' title=''/><author><name>Michael Tsai</name><uri>https://www.blogger.com/profile/00364693770445538641</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-632975496229938580' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/632975496229938580' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2010/10/18 凌晨3:44"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-2104194681734685518</id><published>2010-10-18T03:34:41.233+08:00</published><updated>2010-10-18T03:34:41.233+08:00</updated><title type='text'>1. 關於這點,你可以從呼叫端的角度來思考。MSDN 上面說的,位元組陣列的例子,確實不適合用來當作...</title><content type='html'>1. 關於這點,你可以從呼叫端的角度來思考。MSDN 上面說的,位元組陣列的例子,確實不適合用來當作參數陣列,因為在實際使用時,呼叫端很少會傳入不明個數的參數,而是會先準備好陣列的內容,再把整個陣列傳過去。想想看你是否會以這種方式呼叫一個函式:&lt;br /&gt;&lt;br /&gt;StrangeParamsArray(0x00, 0x11, 0x22, 0xaa, 0xff, 0xcc);&lt;br /&gt;&lt;br /&gt;我想應該很少人會這樣寫。你可以拿 String.Format 的例子來看,它的不定參數傳遞,使用起來是不是很方便?因為你每次需要呼叫時,傳入的參數都可以隨當時的需要而有不同的個數。&lt;br /&gt;&lt;br /&gt;2. string [] RecevieData=&amp;quot;00 11 22 AA FF CC&amp;quot;;&lt;br /&gt;這只是陣列的宣告,並不是不固定的個數資料。如第一點所說,「不固定」,是從呼叫端的角度來看的,是傳入參數時的寫法可以用 (參數1, 參數2, 參數3.....) 這樣不斷以逗號分隔的不定參數,才有意義。&lt;br /&gt;&lt;br /&gt;如果你的程式其實都是傳固定的陣列,就不要宣告為 params(雖然一樣可以傳固定陣列,這點我在課堂上有 demo),因為意義不大 ==&amp;gt; 呼叫端使用時如果每次都要先建立一個陣列,那又何必為函式的參數加上 params 宣告呢?用單純的陣列就足夠了。&lt;br /&gt;&lt;br /&gt;簡單來說,如果你在設計一個函式時,希望呼叫這個函式的人可以用 (p1, p2, p3, ....) 這樣以逗號分隔方式傳入不定個數參數的寫法,那就是使用 params 的時機了。除此之外,用陣列就好囉。所以一般我們用到 params 的情況,其實不多啦!&lt;br /&gt;&lt;br /&gt;希望以上有回答你的問題。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/2104194681734685518'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/2104194681734685518'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html?showComment=1287344081233#c2104194681734685518' title=''/><author><name>Michael Tsai</name><uri>https://www.blogger.com/profile/00364693770445538641</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-632975496229938580' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/632975496229938580' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2010/10/18 凌晨3:34"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-3958121975989324736</id><published>2010-10-18T03:34:20.767+08:00</published><updated>2010-10-18T03:34:20.767+08:00</updated><title type='text'>1. 關於這點,你可以從呼叫端的角度來思考。MSDN 上面說的,位元組陣列的例子,確實不適合用來當作...</title><content type='html'>1. 關於這點,你可以從呼叫端的角度來思考。MSDN 上面說的,位元組陣列的例子,確實不適合用來當作參數陣列,因為在實際使用時,呼叫端很少會傳入不明個數的參數,而是會先準備好陣列的內容,再把整個陣列傳過去。想想看你是否會以這種方式呼叫一個函式:&lt;br /&gt;&lt;br /&gt;StrangeParamsArray(0x00, 0x11, 0x22, 0xaa, 0xff, 0xcc);&lt;br /&gt;&lt;br /&gt;我想應該很少人會這樣寫。你可以拿 String.Format 的例子來看,它的不定參數傳遞,使用起來是不是很方便?因為你每次需要呼叫時,傳入的參數都可以隨當時的需要而有不同的個數。&lt;br /&gt;&lt;br /&gt;2. string [] RecevieData=&amp;quot;00 11 22 AA FF CC&amp;quot;;&lt;br /&gt;這只是陣列的宣告,並不是不固定的個數資料。如第一點所說,「不固定」,是從呼叫端的角度來看的,是傳入參數時的寫法可以用 (參數1, 參數2, 參數3.....) 這樣不斷以逗號分隔的不定參數,才有意義。&lt;br /&gt;&lt;br /&gt;如果你的程式其實都是傳固定的陣列,就不要宣告為 params(雖然一樣可以傳固定陣列,這點我在課堂上有 demo),因為意義不大 ==&amp;gt; 呼叫端使用時如果每次都要先建立一個陣列,那又何必為函式的參數加上 params 宣告呢?用單純的陣列就足夠了。&lt;br /&gt;&lt;br /&gt;簡單來說,如果你在設計一個函式時,希望呼叫這個函式的人可以用 (p1, p2, p3, ....) 這樣以逗號分隔方式傳入不定個數參數的寫法,那就是使用 params 的時機了。除此之外,用陣列就好囉。所以一般我們用到 params 的情況,其實不多啦!&lt;br /&gt;&lt;br /&gt;希望以上有回答你的問題。</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/3958121975989324736'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/3958121975989324736'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html?showComment=1287344060767#c3958121975989324736' title=''/><author><name>Michael Tsai</name><uri>https://www.blogger.com/profile/00364693770445538641</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:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-632975496229938580' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/632975496229938580' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1825873726"/><gd:extendedProperty name="blogger.displayTime" value="2010/10/18 凌晨3:34"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-3322241424274442014</id><published>2010-10-17T22:52:28.255+08:00</published><updated>2010-10-17T22:52:28.255+08:00</updated><title type='text'>關於參數陣列不懂地方請老師解達:&#xa;老師我在msdn查到params 用法時機&#xa;http://msdn...</title><content type='html'>關於參數陣列不懂地方請老師解達:&lt;br /&gt;老師我在msdn查到params 用法時機&lt;br /&gt;http://msdn.microsoft.com/zh-tw/library/ms229008.aspx&lt;br /&gt;&lt;br /&gt;1.不懂以下說法&lt;br /&gt;&lt;br /&gt;如果呼叫端幾乎都已經在陣列中有輸入,則不要使用 params 陣列。&lt;br /&gt;&lt;br /&gt;例如,位元組資料通常會儲存在位元組陣列中,並在其中管理。&lt;br /&gt;將 params 關鍵字加入到位元組陣列參數中並不適合一般的情況,&lt;br /&gt;因為開發人員通常不會使用尚未儲存在位元組陣列中的個別位元組。&lt;br /&gt;&lt;br /&gt;2.恆 逸課本中參數陣列&amp;quot;可接收不固定個數的同型別資料&amp;quot;&lt;br /&gt;&lt;br /&gt;string [] RecevieData=&amp;quot;00 11 22 AA FF CC&amp;quot;;&lt;br /&gt;上述宣告這樣代表不固定個數資料嗎&lt;br /&gt;如果不加params 就像以下傳遞陣列當做參數 列子是不是&lt;br /&gt;http://msdn.microsoft.com/zh-tw/library/hyfeyz71%28VS.80%29.aspx&lt;br /&gt;&lt;br /&gt;那如果宣告string [] Data=new string[500];&lt;br /&gt;每次傳至funtion(方法)都是固定字數就不必加params時機比較不會發生錯誤違機&lt;br /&gt;不知道第二我理解對不對</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/3322241424274442014'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/3322241424274442014'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html?showComment=1287327148255#c3322241424274442014' title=''/><author><name>Anonymous</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-632975496229938580' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/632975496229938580' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1283929094"/><gd:extendedProperty name="blogger.displayTime" value="2010/10/17 晚上10:52"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-5756366893101561133</id><published>2010-09-21T00:17:37.507+08:00</published><updated>2010-09-21T00:17:37.507+08:00</updated><title type='text'>Thanks!</title><content type='html'>Thanks!</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/5756366893101561133'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/5756366893101561133'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html?showComment=1284999457507#c5756366893101561133' title=''/><author><name>Anonymous</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-632975496229938580' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/632975496229938580' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1283929094"/><gd:extendedProperty name="blogger.displayTime" value="2010/9/21 凌晨12:17"/></entry><entry><id>tag:blogger.com,1999:blog-4500363753981919783.post-5934198033330644677</id><published>2010-09-10T10:41:47.717+08:00</published><updated>2010-09-10T10:41:47.717+08:00</updated><title type='text'>感謝分享</title><content type='html'>感謝分享</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/5934198033330644677'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4500363753981919783/632975496229938580/comments/default/5934198033330644677'/><link rel='alternate' type='text/html' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html?showComment=1284086507717#c5934198033330644677' title=''/><author><name>Anonymous</name><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/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='https://www.huanlintalk.com/2010/09/my-visual-c-2010-keybinding-poster.html' ref='tag:blogger.com,1999:blog-4500363753981919783.post-632975496229938580' source='http://www.blogger.com/feeds/4500363753981919783/posts/default/632975496229938580' type='text/html'/><gd:extendedProperty name="blogger.itemClass" value="pid-1283929094"/><gd:extendedProperty name="blogger.displayTime" value="2010/9/10 上午10:41"/></entry></feed>