How to Create a Text File in C# ?

Below is a sample code snippet that demonstrates how to create a text file in C#.

How to Create a Text File in C# ?

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.IO;
namespace AbundantcodeConsoleApp
{
    internal class Program
    {
        private static void Main(string[] args)
        {
           string ACFile = @"E:\input.txt";
           System.IO.StreamWriter writer = File.CreateText(ACFile);
           Console.ReadLine();
        }     
    }
    
}