Files, text, time and data

This part of the C# course leaves memory. It writes and reads files and directories, takes a stream with its encoding, and puts a record through System.Text.Json in both directions. The text tools follow — Regex, dates, cultures and parsing — and the part closes with paths, the environment and the processes a program starts.

6.1 Files and directories File, Directory, FileInfo, Exists, Delete, a temporary folder Open 6.2 Streams and encoding FileStream, StreamReader, StreamWriter, buffering, encoding Open 6.3 System.Text.Json: writing Serialize, options, indented output, a record as a payload Open 6.4 System.Text.Json: reading Deserialize, JsonDocument, a missing property, JsonException Open 6.5 Regex groups, named groups, Replace, a timeout, GeneratedRegex Open 6.6 DateTime, DateTimeOffset and TimeSpan UtcNow, arithmetic, a duration, offset against kind Open 6.7 Culture and formatting CultureInfo, invariant culture, number and date formats Open 6.8 Parsing text into values int.Parse, TryParse, a culture, FormatException Open 6.9 Paths Path.Combine, GetFileName, GetTempPath, relative and absolute Open 6.10 Environment and processes environment variables, the working directory, Process Open

Lessons