Easiest is StreamReader and StreamWriter:
using (var writer = new StreamWriter(@"C:\blah\somefile.txt"))
{
writer.WriteLine("Hello!");
}
using (var reader = new StreamReader(@"C:\blah\somefile.txt"))
{
var line = reader.ReadLine();
}
More Related Contents:
- CMD command on c#
- Make an Installation program for C# applications and include .NET Framework installer into the setup
- Can’t view designer when coding a form in C#
- How to update GUI with backgroundworker?
- How to render a formula in WPF or WinForms
- Make ListView.ScrollIntoView Scroll the Item into the Center of the ListView (C#)
- addFontFile from Resources
- Visual Studio build fails: unable to copy exe-file from obj\debug to bin\debug
- Is the size of a Form in Visual Studio designer limited to screen resolution?
- How do I create a C# app that decides itself whether to show as a console or windowed app?
- Unable to copy a file from obj\Debug to bin\Debug
- Windows Forms window changes its size when I create a WPF window
- How can SynchronizationContext.Current of the main thread become null in a Windows Forms application?
- Detecting whether on UI thread in WPF and Winforms
- How to programmatically mouse move,click,right click and keypress, etc. in winform and wpf?
- Convert System.Drawing.Icon to System.Media.ImageSource
- How can we change the background color of all other forms from one form?
- Show controls added programmatically in WinForms app in Design view?
- Can’t use System.Windows.Forms
- Save Settings in VB.Net or C#
- How to force my C# Winforms program run as administrator on any computer?
- How to programmatically include a file in my project?
- How to display text with subscripts or superscripts in the Title Bar?
- User Control vs. Windows Form
- F5 or Start Debugging Button is Greyed Out for Winform application?
- WPF C# InputBox
- How do I set the size of the visible area of a form, minus heading and borders?
- Prism assembly reference failure: System.Windows.Interactivity
- Custom Color Palette in Visual Studio Color Property Editor
- Open WPF window in WindowsForm APP [duplicate]