2
I need to create a report and save this report in a folder inside the C disk: from the computer, I’m only able to save the file without the contents and with the name blank.
The code to save:
string folder = System.Configuration.ConfigurationManager.AppSettings["Relatorios"] + usuario;
string arquivo = folder + @"\" + nomearquivo;
if (!Directory.Exists(folder))
{
Directory.CreateDirectory(arquivo + ".txt " + relatorio);
}
if (!File.Exists(arquivo))
{
File.Create(arquivo+".txt " + relatorio);
}
else
{
File.Delete(arquivo);
File.Create(arquivo + ".txt " + relatorio);
}
Can be an example with any content?
– Jéf Bueno
may be yes...
– Douglas Castro
Douglas, did any of the answers solve your problem?
– Jéf Bueno
It was, I just can’t save with the report
– Douglas Castro
Ok, so you can mark the answer that solved your problem as correct using the ✓ on her left side, right? About the new problem, you can open a new question at any time if you are in need of help.
– Jéf Bueno
very good, the problem is that the file doesn’t update as you add characters
– HeiGames