File copy to remote pc getting error Access to the path denied

  • Thread starter Thread starter Sudip_inn
  • Start date Start date
S

Sudip_inn

Guest
i have to copy files from my local folder to another pc folder. another pc folder i can manually open and i can copy file there manually.

when i am trying to copy files from my local folder to another pc folder then i am getting error Access to the path denied

another pc folder path look like \\172.17.11.18\Bench\OriginalModel\2020-09-30\UAL and here i like to copy file programmatically

my local path look like C:\Users\tdp\Desktop\Model\GR_AAL.xlsx

finally below code trying to copy files from local folder to remote pc folder. here is code

localfilepath = Path.Combine(txtPath.Text.Trim(), Path.GetFileName(model.ModelFilePath));
remotefilepath = model.ModelFilePath;
File.Copy(@localfilepath, @remotefilepath, true);

please tell me where i am making the mistake for which i am getting error called Access to the path denied

Thanks

Continue reading...
 
Back
Top