Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to replace the existing files or folders and copy new ones with the same name.

I want to do this task using form created in C# where i can give source file/folder & Hostnames or IP addresses of systems connected in network.

Any best way to do this?

Thanks,
Swapnil B

What I have tried:

i have created a form mentioning source and destination text boxes in the same and buttons for COPY, MOVE, RENAME etc.
Posted
Updated 16-Aug-17 1:08am
Comments
Richard MacCutchan 13-Aug-17 13:47pm    
You will need some client application on the source host that feeds the copy/move request. One possibility is using a ftp script.
Member 13359397 14-Aug-17 13:34pm    
Thanks for suggestion... but is it really quite difficult using C# code to copy files within network?

Thanks,
Swapnil B
Richard MacCutchan 14-Aug-17 14:10pm    
No, it's very easy. But you must ensure that your network and the relevant computers are setup to allow it.
PIEBALDconsult 13-Aug-17 13:50pm    
File.Copy Method (String, String, Boolean)

https://msdn.microsoft.com/en-us/library/system.io.file.copy(v=vs.110).aspx
gggustafson 13-Aug-17 13:56pm    
You mat find the contents of WebOpenFileDialog useful.

1 solution

I've done a little research and these two links should cover everything that you need:

1. Connect to a UNC Path with Credentials[^]

2. filesystems - Determining if file exists using c# and resolving UNC path - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900