Is it possbile to loop through a C# Class object?
<p>I have a C# class that I want to loop through the properties as a key/value pair but don't know how.</p>

<p>Here is what I would like to do:</p>

<pre><code>Foreach (classobjectproperty prop in classobjectname)
{
    if (prop.name == "somename")
        //do something cool with prop.value
}
</code></pre>

<p>Thanks in advance for the help.</p>
