«前の日記(2005-02-28) 最新 次の日記(2005-03-02)» 編集

ToDo:

  • 99 深呼吸して、おちけつ (~12/31 あと287日)
  • 98 毎日アウトプットを重きにおいた目標をたてる (~12/31 あと287日)
  • 97 買物は行動を変えるもの・ことに限る (~12/31 あと287日)
  • 96 合理的な行動はときに我慢を強いる(~12/31 あと287日)

ɥozɐʞıɥ


2005-03-01 鐚iet緇柑障 [長年日記]

_ [Diet] ゃ<

蚊宴⒢絎音ゃc若鐚 蕋狗⒢

[Win] с

罨<羔我莢激

[C#] Reflection

using System;

namespace ConsoleApplication1

{

[AttributeUsage(AttributeTargets.Field)]

class SampleAttribute : Attribute

{

private string _name;

public string name

{

get { return _name;}

}

public SampleAttribute()

{

_name = this.GetType().ToString();

}

}

class Class1

{

[Sample]

public string _prop ;

[STAThread]

static void Main(string[] args)

{

Class1 obj = new Class1() ;

System.Reflection.FieldInfo [] lists = obj.GetType().GetFields();

foreach(System.Reflection.FieldInfo i in lists)

{

object[] ls = i.GetCustomAttributes(typeof(SampleAttribute),true);

foreach(SampleAttribute sa in ls)

{

System.Console.WriteLine("{0}",sa.name);

}

}

}

}

}



2002|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|
«前の日記(2005-02-28) 最新 次の日記(2005-03-02)» 編集