Richard Oden12,878 Points
Why not use currentDirectory instead of directory.FullName for Path.Combine?
In the video, Carling first uses
Directory.GetCurrentDirectory() to get a string containing directory's path. She then uses this string to make a
DirectoryInfo object and uses its
FullName property, which is also a string containing the path.
Could you not just use
currentDirectory directly inside
Path.Combine and cut out the middle man?
string currentDirectory = Directory.GetCurrentDirectory(); var fileName = Path.Combine(currentDirectory, "data.txt");