using System.Reflection;using System.CodeDom.Compiler;using System.Text;using Microsoft.CSharp; class sample{ protected Type BuildExtendType(Type sourceType, PropertyInfo[] extenders) { StringBuilder codeBuilder = new
/*======================================================================== File: TypeResolve.cs Summary: This file implements "type resolution" sample. This sample demonstrates how hosts can participate in the type resolution
public interface IController { string GetName(); } public interface IAggInterface { string GetInnerName(); } public class Aggregate:IAggInterface { public string GetInnerName() {
//非託管資源 class UnmanagedObject { //類比非託管操作 public void DoUnmanagedWork() { Console.WriteLine("do unmanaged work now..."); } //自訂非託管操作釋放操作 public void DoCleanup()
1.webservice協助類---------------------------------------------------------------------------------------------------------------public class WebServiceHelper { public static string CallServiceByGet(string strURL) {
1.通過var關鍵字實現靈活的型別宣告:class ImplicitlyTypedLocals2{ static void Main() { string[] words = { "aPPLE", "BlUeBeRrY", "cHeRry" }; // If a query produces a sequence of anonymous types, // then you must also use var