I am struck with something related to the server path. I am trying to give a server path into the DirectoryInfo(), but it is taking the local directory path and saying that the path specified is not found. So can someone help me out in doing this.
You are confusing variable names and string constants. new DirectoryInfo(sou) for one. Move the "sou" declaration out of the if statement. An introductory book on C# programming would be highly advisable.
This is my code I want to take the source path from the xml node and give it into the DirectoryInfo which will be copied to destination in the same way.
foreach
(XmlNode node in nodes)
{
String name = node.Name;
if (name == "Source")
{
DirectoryInfo source = new DirectoryInfo(node.InnerText);
String sou = node.InnerText.ToString();
}
else
{
String des = node.InnerText;
}
DirectoryInfo dir = new DirectoryInfo("Source");
FileInfo[] f = dir.GetFiles("*");
foreach (FileInfo file in dir.GetFiles("*"))
You are confusing variable names and string constants. new DirectoryInfo(sou) for one. Move the "sou" declaration out of the if statement. An introductory book on C# programming would be highly advisable.