With this code I can copy an xml file from the internet and save it in a folder.
WebClient client = new WebClient();
client.DownloadFile("http://www.studiovincent.net/list.xml", "test.xml");
The code works fine, but I need the test.xml file (file copied into the folder) to be hidden, so that it is visible only if I turn on “show hidden file and folders”.
You need to set the file attributes, use
File.SetAttributesfor this. Though I also useFile.GetAttributesfirst so that any existing attributes will be preserved.MSDN:
http://msdn.microsoft.com/en-us/library/system.io.file.setattributes.aspx