Answers

This section contains the solutions to the thought experiments and answers to the lesson review questions in this chapter.

Objective 4.1: Thought experiment

  1. You can use DirectoryInfo and FileInfo classes for searching through folders for the specified files. You can use the Path class for making sure that the locations given to you by the customer are valid.

  2. You can use a search pattern when looking for files. By using a search pattern such as “*.docx,” you can find all Word documents in a directory.

  3. Yes. You are working with I/O in a desktop application. If you use synchronous code, the user interface appears to crash or become unresponsive each time you iterate over your folders or files. By making the application asynchronous, the user ...

Get Exam Ref 70-483: Programming in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.