Posted on: 3/29/2015 7:29:58 PM | Views : 665

Hi All,
I would like to first create a new dir and then save a file into the following location C:\Users\Paul\Documents + \newfolder\nameOffile.xml.
Can this be achieved in C#. I currently have the following code but i cant seem to get it to work
XDocument doc = new XDocument(rootNode); var dateAndTime = DateTime.Now; var date = dateAndTime.Date.ToString("dd-MM-yyyy"); var patWithoutExtension = Path.GetFileNameWithoutExtension(openFileDialog1.FileName); string savedFilePah = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); var savedFile = savedFilePah + "/" + Directory.CreateDirectory("newFolder") + "/" + patWithoutExtension + "_" + date + ".xml"; //var savedFile = "C:/tmp/" + patWithoutExtension + &q ...

Go to the complete details ...