Tsallaka zuwa abun ciki
Justice Tech School

Files with File and Path

File.WriteAllText, ReadAllText and ReadAllLines handle small files. Path builds paths.

Example
var p = Path.Combine(Path.GetTempPath(), "demo.txt");
File.WriteAllText(p, "one\ntwo\n");
foreach (var line in File.ReadAllLines(p)) Console.WriteLine(line);
File.Delete(p);

Exercise

Combine paths.

Path.("a", "b")

Quiz Test

What does ReadAllLines return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.