title: File.Copy() to file server with network Credential
body: <p>I am writing console application which will Copy file from my local disk to file server.  This folder is protecting by username and password. <code>File.Copy()</code> method does not work. It gives permission error. <a href="https://stackoverflow.com/questions/766033/copy-file-to-remote-computer-using-remote-admin-credentials/766086#766086">I have looked to this code</a></p>
  
  <p>I have tried it but it does not work. First it was written in VB but I have changed the code to C# but there are have some errors. I don't know what does this error mean.  Maybe you can advise me other way coping  file to protected File Server</p>
  
  <p><strong>with simple File.Copy(bla bla) it gives me "you have not permission"</strong></p>
  
  <p><strong>when i converted VB code to C# it gived me error below: Attempted to read or write protected memory</strong></p>
  
  <p>I have found solution</p>
  
  <p><a href="https://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a-network-share">You can Follow It</a></p>