using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace FileApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("***** Simple IO with the File Type ******");
string[] myTasks = { "asdf", "qwerty", "awdx", "1234" };
// Write out all data to file on C drive.
File.WriteAllLines(@"C:\tasks.txt", myTasks);
// Read it all back and print out
foreach (string task in File.ReadAllLines(@"C:\tasks.txt"))
{
Console.WriteLine("TODO: {0}", task);
}
Console.ReadLine();
}
}
}
The program could not access tasks.txt, I attached a screenshot of problem.