📄 25.17.txt
字号:
Listing 25.17 Obtaining Object References for the Attributes Applied to a Method
Type type = typeof(MyClass);
MethodInfo method = type.GetMethod(“DoSomething”);
object [] attribs = method.GetCustomAttributes(false);
foreach (object attrib in attribs)
{
// do something with the attribute object reference, for example:
Console.WriteLine(attrib.ToString());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -