title: How to create a Class with List<> properties
body: <p>The problem:
  - I want to read filename into a List&lt;> inside a class.</p>
  
  <ol>
  <li><p>How to I read the filename into List&lt;> in foreach Statement?</p></li>
  <li><p>How to set up the get and set statement in List&lt;> properties in the class.</p></li>
  <li><p>For this operation, which type to use: static class or normal class?</p></li>
  </ol>
  
  <p>------revise------------- This is the problem :</p>
  
  <p>sorry for the confusion. </p>
  
  <p>What I wanted is to add the filenames into the List&lt;> in the class. I want to have a list of filename in the List for later use.</p>
  
  <p>1) How do I add the filename into the List  g_Photoname in the Class in Click Event or Page Load Event?</p>
  
  <p>protected void Button_Click(object sender, EventArgs e)   </p>
  
  <p>{</p>
  
  <p>//-1- Get  all the files in Temp directory </p>
  
  <pre><code>       var pe = new PicExample(@"c:\temp\");  
  
  
  
          foreach (string f in pe.FileList) 
          { 
  
     // Question : How do I add the f in the List&lt;&gt; in this class ?
  
    //  PhotoNameCollection = f ;  ???  Can do?
  
  
          } 
  </code></pre>
  
  <p>} </p>
  
  <p>2) Create a static class to hold the list of filename in the List&lt;> in class</p>
  
  <p>a) How do I set up the get ad set statement for the List&lt;> in this class?</p>
  
  <p>b) Is the List&lt;> correcctly used in this class?</p>
  
  <pre><code>public class PhotoNameCollection
  {
      private List&lt;string&gt; g_Photoname
  
  
      public List&lt;string&gt; PhotoName
      {
          get 
      {
  
       }
  
     set
          {
      }
  
      }
  
   }
  </code></pre>