1 [DllImport] public class MyDllimportClass {} 2 3 [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] 4 [DllImport("user32.dll", ExactSpelling=false, SetLastError=false)] 5 [DllImport("user32.dll")] 6 TraceMethod()7[Conditional("DEBUG"), Conditional("TEST1")] void TraceMethod() {} 8 9 using System; 10 [AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)] 11 public class Author : Attribute 12 { Author(string name)13 public Author(string name) { this.name = name; version = 1.0; } 14 public double version; 15 string name; 16 } 17 18 [AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, 19 AllowMultiple=true)] // multiuse attribute 20 public class Author : Attribute 21 { 22 } 23