I have seen this post How to correctly open a FileStream for usage with an XDocument but it doesn’t help me since I don’t have the path to the file on the local hard drive. This XDocument is getting passed to another computer so the BaseURI is worthless.
I want to know how to convert an XDocument into a FileStream without using a local file path.
A
FileStreamis used to write directly to a file, so if you don’t have a file path, you don’t have aFileStream.You can, however, write to other streams, like a
MemoryStream: