1
I have the following code:
using (var stream = new System.IO.StreamWriter(System.IO.File.Open("c:\\file.xml",
FileMode.OpenOrCreate, FileAccess.ReadWrite)))
{
infoSerializer.Serialize(stream,
Functions.ConvertLayoutConsultarSituacaoLoteRpsEnvio(objeto,
Functions.PadraoNFSe(codigoMunicipio)));
stream.Close();
}
In case the Streamwriter creates a file in the C directory: but instead of creating a file I wanted to save the information in memory, whether in a Stream or even in a string, how should I change this code snippet so I can make this change?
What "information" you want?
– Jéf Bueno
It creates an Xml file from an Nfse batch query.
– Brayan
And what you want to do?
– Jéf Bueno
Instead of saving this xml to a physical file, I would like to save the content to a string or stream, without creating the . xml file
– Brayan
This was answered in the linked question.
– Jéf Bueno