Why does the following code produce no output?
static void Main(string[] args)
{
FieldInfo[] fi = typeof(MyStruct).GetFields(BindingFlags.Public);
foreach (FieldInfo info in fi)
{
Console.WriteLine(info.Name);
}
}
public struct MyStruct
{
public int one;
public int two;
public int three;
public int four;
public int five;
public int six;
public bool seven;
public String eight;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…