Use the following example code, if you want to write to a text file using C Sharp/C#.

using System;
using System.IO;

class MainClass
    public static void Main()
        FileStream trialStream = new FileStream("sampleText.txt", FileMode.Create);

        StreamWriter trialWrite = new StreamWriter(trialStream );

        trialWrite.WriteLine("{0} {1}", "CoderzHeaven", 100);


        trialStream .Close();



Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.