namespace mcMath { using System; public class mcMathComp { private bool bTest = false; public mcMathComp() { } public long Add (long val1, long val2) { return val1 + val2; } public bool Extra { get { return bTest; } set { bTest = Extra ; } } } } 7.生成DLL
mcMathComp cls = new mcMathComp(); long lRes = cls.Add( 23, 40 ); cls.Extra = false;
下面是完整的程序代码:
namespace mcClient { using System; using mcMath; public class Class1 { public Class1() { } public static int Main(string[] args) { mcMathComp cls = new mcMathComp(); long lRes = cls.Add( 23, 40 ); cls.Extra = false; return 0; } } }