Yan*_*ang 8 c# filesize winrt-async
在WinRT中没有FileInfo
类,只有一个StorageFile
类.
如何使用StorageFile
该类获取文件的大小?
Vah*_*and 11
所以你走了:
storageFile.getBasicPropertiesAsync().then(
function (basicProperties) {
var size = basicProperties.size;
}
);
Run Code Online (Sandbox Code Playgroud)
Bos*_*Bos 11
在C#中:
StorageFile file = await openPicker.PickSingleFileAsync();
BasicProperties pro = await file.GetBasicPropertiesAsync();
if (pro.Size != 0){}
Run Code Online (Sandbox Code Playgroud)
您应该使用Windows.Storage.FileProperties for BasicProperties.
归档时间: |
|
查看次数: |
6363 次 |
最近记录: |