Z
Z
Zuko9782015-08-14 18:50:14
Windows phone
Zuko978, 2015-08-14 18:50:14

What can replace the XDocument.Save(string) function on Windows Phone?

I'm using XDocument.Load to read a file, then I act on the file. But how do you save changes to a file? The wonderful function XDocument.Save(string), where you just need to specify the path to the file, does not work on WP. There is XDocument.Save(Stream), but I don't understand where the stream has to do with it. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Dubina, 2015-08-28
@Dmitrydprog

A stream can also be a file stream.

using ( FileStream stream = File.OpenWrite(filePath) )
{
    XDocument.Save(stream);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question