Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,911 questions

51,843 answers

573 users

How to append data to a file in C#

1 Answer

0 votes
using System;
using System.IO;

namespace Append_Data_To_TextFile
{
    class Program
    {
        static void Main(string[] args)
        {
            FileStream fs = new FileStream("d:\\test.txt", FileMode.Append, FileAccess.Write);

            StreamWriter sw = new StreamWriter(fs);

            sw.WriteLine("The append line");
            sw.Close();
            fs.Close();
        }
    }
}



answered Sep 3, 2014 by avibootz

Related questions

1 answer 222 views
222 views asked Aug 15, 2014 by avibootz
1 answer 185 views
185 views asked Apr 26, 2017 by avibootz
1 answer 171 views
1 answer 147 views
1 answer 207 views
4 answers 159 views
159 views asked Oct 18, 2023 by avibootz
1 answer 118 views
...