抽象工廠設計模式(C#)什麼是抽象工廠設計模式呢?假如我們建立了一個類如下:public abstract class class1{public virtral int aaa(){ }public virtral int bbb(){ }......}我們知道用abstract聲明的類必須使用繼承才能使用,例如我們可能在sqlserver下使用,也可能在Oracle下使用,那麼我們不得不分別寫sqlserver下的繼承類和Oracle下的繼承類,如下:public class
1、定義:/**//// <summary> /// 定義ITP Head資訊的結構體變數(siteID、productLineID、priceType、year、period) /// </summary> public struct ITPHeadInfor { public int siteID; public int productLineID;
C++ 0x keynote(以下簡稱0x)中描述了這樣一個看起來不錯的東西:1、本地調用代碼: // use local object: X x; A a; std::string s("abc"); // … x.f(a, s); 2、使用遠程代理wrapper層: // use remote object : proxy<X> x; x.connect("my_host"); A a; std::string s("abc"); // … x.f(a, s);
using System;using System.Runtime.InteropServices; class shoutdown{ [StructLayout(LayoutKind.Sequential, Pack=1)] internal struct TokPriv1Luid { public int Count; public long Luid; public int Attr; } [DllImport("kernel32.d
Best C# BlogsPosted by timm 23 Comments » What makes a C# blog good? Pretty much the same thing that makes any blog good, but with a focus on C#, of course. Good C# blogs have:Useful news, information, tips and code samplesRegular updatesOriginal
View Code 1 using System; 2 using System.Data; 3 using System.Configuration; 4 using System.Web; 5 using System.Web.Security; 6 using System.Web.UI; 7 using System.Web.UI.WebControls; 8 using System.Web.UI.WebControls.WebParts; 9 using
概述在我以前做項目時,讀DbDataReder裡的值時都會用Reader.Read()然後根據名字來逐個讀出.自從學會利用反射來讀後,一切變得很容易.以前的做法定義一個Entity public class FileInformationModel { #region Public Property /// <summary> /// Gets and sets the file ID ///