I am trying to copy files at specific directory from my pc to remote pc (server)
as shown below but I am getting an error message access to path denied
I tried to copy files to my local pc not the remote one and filed for the same reason
I also tried to run the exe
as administrator form Debug
foleder but I got same error message
another question for now the remote pc has no password or username so can I use same way but with password authentication ?
private void PatchUpdates()
{
try
{
string[] array = Directory.GetFiles(Sfilespath, "*.txt");
foreach (string name in array)
{
MessageBox.Show(Path.GetFileNameWithoutExtension(name));
MessageBox.Show(@"D:\" + Path.GetFileNameWithoutExtension(name));
File.Copy(Sfilespath, @"D:\" + Path.GetFileNameWithoutExtension(name), true);
//File.Copy(SBankfilespath, "\\\\192.168.1.28\\Files");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}