public static void Main()
Type t = typeof(UseAttrib);
Console.WriteLine("Атрибуты в классе " + t.Name + ": ");
object[] attribs = t.GetCustomAttributes(false);
foreach(object o in attribs)
Console.Write("Примечание: ");
Type tRemAtt = typeof(RemarkAttribute);
RemarkAttribute ra = (RemarkAttribute)Attribute.GetCustomAttribute(t,tRemAtt);
Console.WriteLine(ra.Remark);
[AttributeUsage(AttributeTargets.All)]
public class RemarkAttribute : Attribute
public RemarkAttribute(string comment)
[RemarkAttribute("В этом классе используется аттрибут.")]