I have a requirement in WPF/C# to click on a button, gather some data and then put it in a text file that the user can download to their machine. I can get the first half of
Here is some sample code:
string fileText = "Your output text"; SaveFileDialog dialog = new SaveFileDialog() { Filter = "Text Files(*.txt)|*.txt|All(*.*)|*" }; if (dialog.ShowDialog() == true) { File.WriteAllText(dialog.FileName, fileText); }