title: access a directory in a domain by username and password
body: <p>I have developed an application in c# using visual studio 2015, that copies some files from one directory (source) to another (destination) in general.
  My problem is that the source path is another computer in a domain. I wish to be able to access the directory and get my files, user the domain, username and password the source computer.
  I have seen some solution, but I can't get how they access the other computer.
  I used to get my files by using the Directory. GetDirectories (path), and I'm far too deep using it now and can't change it to smooth as.
  thanks for helping me with my problem I'm truly blocked for days now.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>string[] folder1;
  string[] folder2;
  folder1 = Directory.GetDirectories(path);
  foreach (string fld1 in folder1)
  {
      folder2 = Directory.GetDirectories(fld);
      foreach(string fld2 in folder2)
      {
          for(int i = 0; i &lt; MyList.Count(); i++)
          {
              if(fld2.Contains("nok") || fld2.Contains("Nok"))
                  LNok = Directory.GetFiles(fld2, picList[i]);
              else
                  Lok = Directory.GetFiles(fld2, picList[i]);
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>