HOW TO CREATE A TEXT FILE IN C# 2017comment box.
Reading: How to create a text file in C#StreamWriter implements a System.IO wrapper that writes characters to a stream in a particular encoding. C# makes use of a element referred to as a STREAM to permit applications to work with documents or files. A movement is a link between your software and a data resource. Data can move up or down your Stream so that streams can be used to study and write to files. The stream is the aspect that links your program with the OS of the computer you're using. Lets put it to use!
[ using System;The 'writeline' method writes the text to the file.
public static void Main(string args)
StreamWriter myWriter = new StreamWriter("My text File");//This will be the title of the text file myWriter.WriteLine("I am just a text file, tutorials on point");//This will be the actual text
The text file will be generated as soon as you launch the program!. In my case, the text file was created in path C:\Users\User\Documents\Projects\tutorial\tutorial\bin\Debug.
If you want to see more of this tutorials like this C#, subscribe to our Newsletter now.