Gregory Pakosz Gregory Pakosz - 1 month ago 14
C# Question

Metro class library, FileInfo replacement?

In one of our components ported from Java to C#, we used

as an equivalent for Java's
File
class.

Now we're working towards making that class library available to Metro applications and we have to pass the certification obviously.

What's a good replacement for
FileInfo
in .NET Framework 4.5 core profile?

dtb dtb
Answer

The StorageFile Class in the Windows.Storage Namespace.

StorageFile class

Represents a file. Provides information about the file and its content, and ways to manipulate them.

Example:

var file = await StorageFile.GetFileFromPathAsync(path);