白话C#:特性(转)
2015-07-02 15:59
841 查看
static void Main(string[] args) { BoardingCheckAttribute boardingCheck = null; object[] customAttributes = typeof(HumanPropertyBase).GetCustomAttributes(true); foreach (var attribute in customAttributes) { if (attribute is BoardingCheckAttribute) { boardingCheck = attribute as BoardingCheckAttribute; Console.WriteLine(boardingCheck.Name + ""s ID is " + boardingCheck.ID + ", he/she wants to " + boardingCheck.Destination + " from " + boardingCheck.Departure + " by the plane " + boardingCheck.FlightNumber + ", his/her position is " + boardingCheck.PositionNumber + "."); } } Console.ReadLine(); }
View Code
相关文章推荐
- C#引用第三方DLL时报无法引用此类名错误
- C#增删改查
- C#验证码
- C# 标识类
- C# Unicode转义(\uXXXX)解码
- 浅析EF涉及的一些C#语言特性
- C# new的用法
- C#获取视频文件的播放时间
- C# 发送电子邮件(含附件)用到的类 system.web.mail
- 在C#主线程和子线程将数据传递给对方如何实现
- C# 概念记忆
- C# 关闭显示器(显示)
- C# Message.msg
- C# Generic(转载)
- [c#][福利]BTTool种子文件修改工具
- C# 你不能调用的问题剪贴板线程
- C#内存释放
- C#软件winform程序安装包制作及卸载程序制作
- c#中跨线程调用windows窗体控件 .我们在做winform应用的时候,大部分情况下都会碰到使用多线程控制界面上控件信息的问题。然而我们并不能用传统方法来做这个问题,下面我将详细的介绍。
- c#中如何跨线程调用windows窗体控件?