关于new 一个接口的有意思的代码
using System; using System.Runtime.InteropServices; namespace Test { internal class A:IA { public void Hello() { Console.WriteLine("Hello World"); } } [CoClass(typeof(A))] [ComImport] [Guid("664DD00E-1469-42EA-825F-CFE2D8C4E528")] internal interface IA { void Hello(); } internal static class Program { static void Main(string[] args) { IA a = new IA(); a.Hello(); Console.ReadLine(); } } }