示例#1
0
        static void Main(string[] args)
        {
            IMyClass a               = null;
            Guid     guid            = new Guid("61D7B4BA-1597-4AAA-93D9-582412D2A04F");
            Type     transactionType = Type.GetTypeFromCLSID(guid);
            object   transaction     = Activator.CreateInstance(transactionType);

            a = transaction as IMyClass;
            int b = a.Add(2, 3);

            Console.WriteLine(b);
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            IMyClass myClass = CreateMyClass();

            Console.WriteLine(myClass.Add(3, 4));
        }