title: Accessing remote folder from win form C#
body: <p>I am developing a winform application on C# where I need to access a network folder but i get logon user password exception. How can i provide user credentials through application?</p>
  
  <pre><code>double length = ((Directory.GetFiles("\\192.168.50.107\Destination", "*", SearchOption.AllDirectories).Sum(t =&gt; (new FileInfo(t).Length)) / 1024) / 1024) / 1024;
  </code></pre>