title: How to get Size of a file in Asp
body: <blockquote>
  <p>hi,</p>
  <p>i am able to get all files in a directory with their path and their files with this code.</p>
  </blockquote>
  <pre><code>    List&lt;ListItem&gt; files = new List&lt;ListItem&gt;();
                     
      string Myfile = &quot;&quot;;
                 
      foreach (string filePath in filePaths)
      {
      files.Add(new ListItem(Path.GetFileName(filePath), filePath));
      }
  </code></pre>
  <blockquote>
  <p>But i cant get sizes of these files. How can i do that. i cant use size property like,</p>
  </blockquote>
  <pre><code>     files[0].size;
  </code></pre>