Time of Update: 2017-02-28
asp.net|資料|資料庫|下載 /* ?——————————————————————————? | Title: ASP.Net C#2.0全能資料庫組件 (開源含執行個體源碼)| | Project:
Time of Update: 2017-02-28
規範 第三章 匿名方法原著:Microsoft Corporation原文:http://msdn.microsoft.com/vcsharp/team/language/default.aspx (SpecificationVer2.doc)翻譯:lover_P出處:--------------------------------------------------------------------------------[內容]3.1
Time of Update: 2017-02-28
規範 4.1 迭代器塊 一個迭代器塊(iterator block)是一個能夠產生有序的值序列的塊。迭代器塊和普通語句塊的區別就是其中出現的一個或多個yield語句。yield return語句產生迭代的下一個值。 yield break語句表示迭代完成。 只要相應的函數成員的傳回值類型是一個列舉程式介面(見4.1.1)或是一個可枚舉介面(見4.1.2),一個迭代器塊就可以用作方法體、運算子體或訪問器體。
Time of Update: 2017-02-28
1. 首先EF的Repository需要抽象的行為提到介面中。例如 :public interface IXXXContext : IDisposable { IXXXContext NewInstance();// db sets DbSet<AAABBB> aaa { get; set; }...// common Database Database { get; } DbContextConfiguration
Time of Update: 2017-02-28
1. package-install GlobalPhone2. Phone.cs聽聽 聽 public class Phone { public string CountryCode { get; set; } public string InternationalNumber { get; set; } public string NationalNumber { get; set; } public string
Time of Update: 2017-03-03
C# xml序列化類別的代碼執行個體詳解using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Xml;using System.Xml.Serialization;using Imps.Services.CommonV4;namespace Imps.Services.IDCService.Utility{ public
Time of Update: 2017-03-03
XML還原序列化很方便,樣本: [XmlRoot(Root = "result")] public class UniMsgSetResult { [XmlAttribute("resultCode")] public int resultCode; [XmlElement("uniMsgSet")] public UniMsgSet uniMsgSet;
Time of Update: 2017-03-02
有時候,當任務比較多的時候,需要做一個隊列。當隊列數量達到一定數量時候,進行出隊並處理,但是如果很長時間都沒有達到那個數量呢?那就加一個時間限制,例如30分鐘,1000個元素,哪一個條件先達到都會執行出隊操作。LazyQueue<T>類的實現:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace
Time of Update: 2017-03-02
1.下載zedGraph控制項:http://download.csdn.net/detail/allisnew/3222512.添加引用 zedGraph.dll3.在工具箱的最後面添加常規控制項--瀏覽--選擇zedgraph.dll4.編寫如下初始化代碼(也可以直接拖一個控制項):private ZedGraphControl zedGraphControl1 = new ZedGraphControl(); this.zedGraphControl1.Location = new
Time of Update: 2017-03-02
c# 隱藏已開啟的視窗,開啟登陸視窗的詳細介紹 FormCollection fc = Application.OpenForms;//獲得已開啟的視窗//迴圈隱藏 if (fc != null && fc.Count > 0) { foreach (Form window in fc) { window.Hide();
Time of Update: 2017-03-01
單擊工作列 顯示-隱藏切換,右鍵菜單,捕捉關閉表單事件 public partial class frmMain : Form { public frmMain() { InitializeComponent(); } #region 登出 public void Logout() { if
Time of Update: 2017-03-01
在一些情境中,需要把多個圖片,合(拼)成為一張 ,合成效果樣本:縱向:橫向:代碼實現: enum ImageMergeOrientation { Horizontal, Vertical }private void CombineImages(FileInfo[] files, string toPath, ImageMergeOrientation mergeType = ImageMergeOrientation.Vertical) {
Time of Update: 2017-03-01
C#中擷取TimeZoneInfopublic TimeZoneInfo TimeZoneInfo { get { var timeZoneInfoString = _user.TimeZoneInfoString; if (!string.IsNullOrEmpty(timeZoneInfoString)) {
Time of Update: 2017-03-01
C# 顯示過去了多長時間的函數public string HowLongBeforeNow { get { var ts = new TimeSpan(DateTime.UtcNow.Ticks - CreatedDate.Ticks); var delta = ts.TotalSeconds; const int second = 1;
Time of Update: 2017-03-01
Layout:<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent"
Time of Update: 2017-03-01
1. axml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"
Time of Update: 2017-03-01
使用C# + Xamarin開發Android應用-- 動態添加控制項public class MyOrders : Activity { private DynamicControl _dynaControl; public MyOrders() { _dynaControl = new DynamicControl(); } protected override void
Time of Update: 2017-02-28
今天偶然與建議不要用for,可讀性太差效能又低,可我個人認為要根據具體情況而定,畢竟for在大部分語言的關鍵字,可讀性不可能因為一個關鍵字的替代而變好,多數取決於設計和編碼習慣。至於效能,打算寫段代碼對它們分別測試一下。var arr = Enumerable.Range(0, 100000000).ToList();var sw = Stopwatch.StartNew();for(var i = 0;i < arr.Count;
Time of Update: 2017-02-28
1. download sqlite dll from:http://www.sqlite.org/download.htmlwindows 版本:http://www.sqlite.org/2016/sqlite-dll-win32-x86-3130000.zip2. 拷貝 sqlite3.dll 到 bin 目錄3. 安裝nuget: Install-Package sqlite-net安裝後會在項目中找到SQLite.CS和SQLiteAsync.cs4. demo 代碼:4.1
Time of Update: 2017-02-28
C# 讀COM PORT參照了MSDN的樣本:https://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx還是不工作,需要加這一行代碼:mySerialPort.DtrEnable = true;DtrEnable屬性的描述:Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial