0
I want to read the text of Textbox (Winforms) and save to the file.
Giving error, saying that the file is being used in another location.
StreamWriter escreverentrada = new StreamWriter(@"escreveentrada.txt",true);
string valor = valortxt.ToString();
string nome = nometxt.ToString();
escreverentrada.WriteLine(valor);
escreverentrada.Close();
The error itself tells the problem... it is open in some method. Give a look
– Leonardo Bonetti
In fact, I created the file in this method there, and would not have the option to use elsewhere. Because it is a private method.
– Hellan Diangell's
If you created it by the app you must have forgotten to give
Dispose()
.– Jéf Bueno
And the reading of the Textlabel right there?
– Hellan Diangell's
Or rather, from TEXTBOX
– Hellan Diangell's