Chapter 8, File and Stream I/O
- Absolute, relative, UNC, and DOS device.
- In the registry editor, set
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled
to1
. - The most efficient way to calculate the size of a directory is to get
DirectoryInfo
for the directory, followed by the call toGetFileSystemInfos()
. You then iterate through the result, adding the length of eachFileInfo
object to get the directory’s size. - The most efficient method of moving files is to obtain
FileInfo
objects from the in-memory cache and then use theFileInfo.MoveTo(string destination)
method to move the file. - When you encounter a non-recoverable exception before you exit the application.
IOException
.- Local, Local Cache, Roaming, Temporary, and C:\ProgramData.
- Users may only install the software for themselves when prompted. This will result in each logged-on person using the software having their own copy of the data, with the data located in...