How to read all content (at once) from a text file in C#

1 Answer

0 votes
using System;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[char.MaxValue];

            string s = File.ReadAllText("d:\\data.txt");

            Console.WriteLine(s);
        }
    }
}

/*
run:
 
java c c++ c# php
javascript
python
    
*/

 



answered Mar 13, 2017 by avibootz

Related questions

2 answers 279 views
2 answers 347 views
1 answer 184 views
1 answer 226 views
1 answer 565 views
1 answer 228 views
5 answers 455 views
...