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 420 views
2 answers 474 views
1 answer 271 views
1 answer 307 views
1 answer 659 views
1 answer 334 views
5 answers 629 views
...