I have a collection containing variables I want to print the names of the variable in this collection
The method that returns the type is working, I couldn't find the name How can I create a function to do this where it says GetName() below
var collection = new List<object> { b,sb,shrt,ushrt,i,ui,lng,ulng,f,d,dec,c,str,b1,b2,b3,o1,o2,o3,o4,dt };
foreach (object item in collection)
{
Console.WriteLine("variable name : "+item.GetName() );
Console.WriteLine("variable value: "+item);
Console.WriteLine("variable type : "+ item.GetType().Name);
Console.WriteLine("***************************** ");
}
