在我们从 Java 移植到 C# 的组件之一中,我们将其用作 Java类FileInfo
的等价物。File
现在我们正在努力使 Metro 应用程序可以使用该类库,显然我们必须通过认证。
FileInfo
.NET Framework 4.5 核心配置文件中有什么好的替代品?
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);
为了同时针对win8平台和silverlight。在您的情况下,这适用于 Metro 应用程序和非 Metro 应用程序,只需创建一个共享文件项目并输入 #if 条件即可。以便它针对两个平台。查看以下链接以创建相同的
http://www.dotnetjalps.com/2015/02/shared-project-visual-studio-2015.html