-1

How can I store data text into string or array in windows store using C#? I tried this method but it did not work:

 string[] phparay ={@"F:\Designe- Video\projects\Phpgonehelp\Phpgonehelp\PHPCODE\Php1.txt"};

I thought this would execute any data from text file, but unfortunately it just prints the text path.

D Stanley
  • 149,601
  • 11
  • 178
  • 240
  • "execute" and "data" somehow contradict each other. May we know how/from where you got the idea that curly braces (`{...}`) somehow enable you to read the content of a file specified by a filename in C#? – O. R. Mapper Jun 02 '15 at 21:12
  • @O.R.Mapper i mean print data BTW –  Jun 02 '15 at 21:13

1 Answers1

0

I think what you'r looking for is this:

string[] lines = System.IO.File.ReadAllLines(@"F:\Designe- Video\projects\Phpgonehelp\Phpgonehelp\PHPCODE\Php1.txt");

this was taken from https://msdn.microsoft.com/en-us/library/ezwyzy7b.aspx

user3164339
  • 165
  • 14