Iterating through Struct members
<p>Lets say we have a struct</p>

<pre><code>Struct myStruct
{
   int var1;
   int var2;
   string var3;
   .
   .
}
</code></pre>

<p>Is it possible to to iterate through the structure's members by maybe using foreach? I have read some things on reflection, but I am not sure how to apply that here.</p>

<blockquote>
  <p>There are about 20 variables in the struct. I am trying to read values
  off a file and trying to assign them to the variables but don't want
  to call file.ReadLine() 20 times. I am trying to access the member
  variables through a loop</p>
</blockquote>
