原创 C# 學習 - & 和 && 的區別

邏輯 AND 運算符 & & 運算符計算操作數的邏輯與。 如果 x 和 y 的計算結果都爲 true,則 x & y 的結果爲 true。 否則,結果爲 false。 即使左側操作數計算結果爲 false,& 運算符也會計算這兩個操作數,

原创 C#學習 - 通過App.Config定義應用程序配置參數

參考:C#的配置文件App.config使用總結

原创 C#學習 - 關於ArraySegment<T>

注意:ArraySegment<T> reference to the original array and does NOT make a copy of it, so the changes of segment will affec

原创 WPF學習 - 關於TranslatePoint()

Point UIElement.TranslatePoint(Point p,UIElement relativeTo)的描述是:將一個UIElement相對於自身的座標轉換爲相對於relativeTo的座標例如private void

原创 C#學習 - IComparer 和 IComparable的區別

IComparer<T> is implemented by types that are capable of comparing 2 different values, whereas an instance of IComparab

原创 C#學習 - 函數參數什麼時候需要用ref關鍵字

提一個問題,函數中有一個Dictionary<string, string>類型的參數,函數中會增加或修改Dictionary中的內容,那麼參數中要使用ref關鍵字麼?答案是:不需要!除非你要改變該參數所引用的Dictionary!看一個

原创 WPF學習 - 關於數據綁定

一篇不錯的文章,詳細闡述WPF數據綁定的各種用法

原创 C#學習 - 關於this的幾種用法

C#中,this 關鍵字的幾種用法1. 用this來區分參數和成員名 public class Person { public enum SEX { MALE, FEMALE };

原创 C#學習 - 關於Single()

Single()嚴格返回一個元素項。如果返回的元素集合爲空,或是返回的元素集合多於一個,Single()就會拋出異常。當程序需要嚴格要求返回一個元素時,不妨嘗試用用Single()。舉例說明: public class Person

原创 C#學習 - 關於async和await

參考:使用 Async 和 Await 的異步編程 (C#) 點贊 收藏 分享 文章舉報 名叫貓的魚 發佈了43 篇原創文章 · 獲贊 16 · 訪問量 5萬+ 私信

原创 C#學習 - 編程指南

C# 編程指南 ( C# Programing Guide )C# 編碼約定 ( C# Coding Convensions ) 點贊 6 收藏 分享 文章舉報 名叫貓的魚 發佈

原创 C#學習 - 關於XML文件的讀寫

直接上代碼說明Xml讀寫1. 寫Xml XmlDocument myXml = new XmlDocument(); XmlNode docNode = myXml.CreateXmlDecl

原创 C#學習- 用FTP(FtpWebRequest/FtpWebResponse)傳輸文件

廢話不說,直接上代碼,一目瞭然 class FtpClient { private string host = null; private string user = null;

原创 WPF學習 - 關於TreeView數據綁定

一篇關於如何在WPF中使用TreeView數據綁定的好文https://blogs.msdn.microsoft.com/mikehillberg/2009/10/30/treeview-and-hierarchicaldatatempl

原创 C#學習 - XML Serialization

將一個對象序列化到XML文件[Serializable] public class SomeClass { public int Field1 { get; set; } public string Field2 { get; s