Is there a way to get a list of properties (variables) on Scripts on an object?

I know I can find a list of scripts (components) on an object thus:

Component[] ss = (Component[])oldTr.GetComponents (typeof(Component));

The question is, is there a way to get the 'custom attributes' or properties or variables on those scripts, without knowing the script's API, so to speak?

In other words, I want to walk through all scripts attached to an object and get all the variables (name and value) for each.

Too slow!

Here's some nuggets:

Component[] cs = (Component[])oldTr.GetComponents (typeof(Component));
foreach (Component c in cs)
{
    Debug.Log("name "+c.name+" type "+c.GetType() +" basetype "+c.GetType().BaseType);
    foreach( FieldInfo fi in c.GetType().GetFields() )
    {
        System.Object obj = (System.Object)c;
        Debug.Log("fi name "+fi.Name+" val "+fi.GetValue(obj));
    }

DaveA... beautiful stuff

This is a comment - comments just don't allow space and formatting.

I was looking for the same feature but could not find any docs on those methods. Can you point to the documentation that covers them?

I am not a C# programmer, I use UnityScript, but I trimmed down your code to get it passed the assembly reference error: (...I am not sure what should be in the 'using (Ref);')

    Component[] cs = g.GetComponents<Component>();
    foreach (Component c in cs)
    {
        Debug.Log("@@ " +g.name +"	["+c.name+"] "+"	" +c.GetType() +"	"+c.GetType().BaseType);
    }

'g' is GameObject var in outer loop. The @@@ makes it easy to find the lines in the log.

The output is exactly what I needed: component name&type list.

Beautiful! Thank you.