Skip to content

Instantly share code, notes, and snippets.

@askingalot
Created October 7, 2019 21:41
Show Gist options
  • Save askingalot/0b6420112b597668d304c1e5d74b7cf3 to your computer and use it in GitHub Desktop.
Save askingalot/0b6420112b597668d304c1e5d74b7cf3 to your computer and use it in GitHub Desktop.
Top 10 Files - A C# Exercise

Top 10 Files

A C# Exercise

Phase 1

Create a console application that displays the top 10 most recently downloaded files in your Downloads directory.

TIP You may find these classes/methods helpful

Phase 2

Modify your program to optionally accept a directory path as a command line argument. Display the top 10 more recent files in that given directory. Use a -d command line flag to specify the directory name.

An example of running your program would look like

dotnet run -d /Users/my-username

TIP Command-Line Arguments (C# Programming Guide)

Phase 3

Modify your program to optionally accept the number of files to display. Use a -n command line flag.

An example of running your program would look like

dotnet run -d /Users/my-username -n 20

Phase 4

Modify your program to show the following info about the recent files it displays.

  • Name
  • Last Access Datatime
  • File Size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment