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; } } }