public static class Program
public static void Main()
var a = new TE{IType = 5, IMaxStack = 90, IWeight = 4, ITerm0fValidity = 22, IDesc = "weqweqwedszx"};
var test_Stream = new MemoryStream(Encoding.UTF8.GetBytes("whataeaweaweawedasdever"));
var writer = new BinaryWriter(test_Stream);
foreach (var propertyInfo in a.GetType().GetProperties())
var t = propertyInfo.GetValue(a, null);
Convert.ChangeType(t, propertyInfo.PropertyType);
Console.WriteLine(t.GetType());
public int IType { get; set; }
public int IMaxStack { get; set; }
public short IWeight { get; set; }
public short ITerm0fValidity { get; set; }
public short ITermOfValidityMi { get; set; }
public string IDesc { get; set; }
public int IUseType { get; set; }
public int IUseNum { get; set; }
public short IStatus { get; set; }