I am attempting to create my final project and I am trying t
I am attempting to create my final project and I am trying to create a GUI program in C# that you can specify a local file and then specify a list of computers and then it will go through and copy that file to a folder in all of those computers. But I am seem to be very lost on how exactly to accomplish that. So any chance someone can give me a little bit of a template to help me get started?
Solution
First it is necessary to check if the local file exist for that you have the file path
now in C# you can check the existance of any file using this:
FIle.Exists(filePath)
now you need to get the list of all computers for that:
var rootDir = new DirectoryEntry(\"WinNT:\")
foreach(var d in rootDir.Children)
{
foreach(var entrypoint in d.Children)
{
//copy the folder using below:
//now just suppose that you have a specified foler in any computer
string directory;
string path = Path.Combine(directory, File.Name);
filePath.Copy(path,false)
}
}
