Beispiel #1
0
        public void RemoteObj(string name)
        {
            Console.WriteLine("\nTo create an instance of IHello");
            Type   objtype = Type.GetTypeFromProgID("HelloCS.HelloImp", true);
            IHello obj     = (HelloCS.IHello)Activator.CreateInstance(objtype);                 // it works by accessing an COM+ object.

            Console.WriteLine("\nTo call obj.HelloWorld() with arg = " + name);
            string reply = obj.HelloWorld(name);

            Console.WriteLine("the reply = " + reply);
        }