Get Types By Objects - CSharp System

CSharp examples for System:Object

Description

Get Types By Objects

Demo Code


using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//  w ww .ja v a  2 s. c  o  m

public class Main{
        public static Type[] GetTypesByObjs(params object[] os)
        {
            var ts = new Type[os.Length];
            for (int i = 0; i < os.Length; i++)
            {
                ts[i] = os[i].GetType();
            }
            return ts;
        }
}

Related Tutorials