0

Please try to suggest me how to do this. I need to copy or move files from one system to another system. I did this but it saying invalid path..

var fileName = "Text.txt";   
var local = Path.Combine(@"C:\\public_html\\TEST\\gr_library\\", fileName );  
var remote = Path.Combine(@"XXX.XXX.X.X\\C:\\public_html\\TEST\\gr_library\\", fileName );  
File.Move(remote, local );

Please give some code snippet which is executable...

Kristijan Iliev
  • 4,901
  • 10
  • 28
  • 47
santhosh
  • 1
  • 1
  • This is not and will never be a valid path. Is the IP address on the same network as you, or is it an over the internet transfer? – Tom Dec 04 '10 at 09:08

1 Answers1

1

You need to put \ in the front of the ip, like \123.456.789.10\folder. Make sure that the user also has access to the remote pc.

Koekiebox
  • 5,793
  • 14
  • 53
  • 88
  • See http://stackoverflow.com/questions/944619/how-to-copy-file-from-local-system-to-other-system-in-c-windows-app – Koekiebox Dec 04 '10 at 09:31