using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { // Choose a path for saving a file string path = "D:\\tmp.txt"; // Enter value for writing into a file string input = Console.ReadLine().ToString(); using (StreamWriter streamWriter = new StreamWriter(path)) { streamWriter.Write(input); } } } }