using System; using System.Collections.Generic; using System.Linq; using System.Reflection; public class Test { public int[] intValues; public static void Main() { string[] arrayData = { "20", "30", "40" }; FieldInfo f = typeof(Test).GetField("intValues"); Type t = f.FieldType.GetElementType(); Test test = new Test(); f.SetValue(test, GenericConvert.ChangeArrayType(arrayData, t)); Console.WriteLine("int values: {0}", string.Join(", ", test.intValues.Select(v => v.ToString())) ); } } public class GenericConvert { public static object ChangeArrayType(IEnumerable a, Type t) { MethodInfo methodDefinition = typeof(GenericConvert).GetMethod("ChangeArrayTypeGeneric"); MethodInfo method = methodDefinition.MakeGenericMethod(t, typeof(S)); return method.Invoke(null, new object[] { a }); } public static T[] ChangeArrayTypeGeneric(IEnumerable a) { return a.Select(x => (T) Convert.ChangeType(x, typeof(T))).ToArray(); } }