I'm creating a .net webform to launch a .exe file located on the user's computer. The .exe accepts parameters, and one of the parameters i'd like to pass to it is an xml file that my webform dynamically generates. I've used XMLWriter to generate the xml, but I need to pass the created XML path to the following call method:
using (Process Ansur = Process.Start(startInfo, "/r " XML File Path ));
I'm lost on how to go about temporarily saving the XML from the XMLWriter in memory, and getting a filepath to pass as a parameter.
I wanted to go about this temporary since then I'd reduce the need to create and modify a XML document on the server side, which I'd assume reduces the need to communicate from the server.
Please help!
Have a look at this answer, it explains how you can obtain a statistically unique temp file path. You can then open a filestream and copy the contents of your memorystream to the file like memory.CopyTo(file)