Hello, thanks for reading my question. I have a string that I need to put on a txt file.
I want to make it so that when the user clicks a button it asks for the folder, where the user wants to save this txt file, and generate it on in folder.
Here is some code I made but I do not know how to make it so that the user to chooses the folder.
private void Generar_Txt_Disco(string s_content, string s_folder)
{
//Ruta es donde se va a guardar
StreamWriter sr = new StreamWriter(s_folder);
//Vas escribiendo el texto
sr.WriteLine(s_content);
//Lo cierras
sr.Close();
}
Description
Use the
SaveFileDialogorFolderBrowserDialogfor that. (Member ofSystem.Windows.Forms)Sample for FolderBrowserDialog
Sample for SaveFileDialog
More Information