using System . Reflection;
public struct Test
{
public string Name;
};
private void button1_Click( object sender , EventArgs e)
{
object Temp;
FieldInfo vFieldInfo = typeof ( Test ) . GetField( "Name" );
Temp = new Test ();
vFieldInfo . SetValue(Temp, "Zswang );
Text = (( Test )Temp) . Name;
}
// or
private void button2_Click( object sender , EventArgs e)
{
Test Temp;
FieldInfo vFieldInfo = typeof ( Test ) . GetField( "Name" );
Temp = new Test ();
object P = ( object )Temp;
vFieldInfo . SetValue(P, "Zswang );
Temp = ( Test )P;
Text = Temp . Name;
}