blah blah blah is here! blah blah » Close

up0down
link

Hi all,
I've got a few questions.
1st. How do I save a text file into an array so that the lines on the text file are different numbers in the array.
2nd. Can I use a random int to select which array value to use and display?
3rd. Can I change the maximum number for my random number to change to the max number of lines in the text file
4th. Is any of this possible in C#?
5th. I am new to C# so could you please make it easy to understand?
Thanks in addvance.

last answered one year ago

1 answers

up1down
link

1. Check out the System.IO.File.ReadAllLines method
2. Yes. Look at the System.Random class
3. Yes. The Next method takes a max value as a parameter
4. All of it ;)
5. I hope this is understandable

vulpes
17279

Good answer, foamy :)

Feedback