StorageFile クラス (Windows.Storage 名前空間)
public sealed class StorageFile : IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem2, IStorageItemProperties2, IStorageItemPropertiesWithProvider
継承:Object → StorageFile
[toc]プロパティ
Attributes
public FileAttributes Attributes { get; }
ContentType
public string ContentType { get; }
DateCreated
public DateTimeOffset DateCreated { get; }
DisplayName
public string DisplayName { get; }
DisplayType
public string DisplayType { get; }
FileType
public string FileType { get; }
- ファイルの拡張子を取得します(.jpgなど)。
FolderRelativeId
public string FolderRelativeId { get; }
Name
public string Name { get; }
- 拡張子も含めたファイル名を取得します。
Path
public string Path { get; }
- ファイルパスが存在する場合は、そのファイルの完全なパスを取得します。
Properties
public StorageItemContentProperties Properties { get; }
Provider
public StorageProvider Provider { get; }
メソッド
CopyAndReplaceAsync
public IAsyncAction CopyAndReplaceAsync(IStorageFile fileToReplace);
CopyAsync
public IAsyncOperation<StorageFile> CopyAsync(IStorageFolder destinationFolder);
public IAsyncOperation<StorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName);
public IAsyncOperation<StorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option);
DeleteAsync
public IAsyncAction DeleteAsync();
public IAsyncAction DeleteAsync(StorageDeleteOption option);
GetBasicPropertiesAsync
public IAsyncOperation<BasicProperties> GetBasicPropertiesAsync();
GetFileFromPathAsync
public static IAsyncOperation<StorageFile> GetFileFromPathAsync(string path);
GetParentAsync
public IAsyncOperation<StorageFolder> GetParentAsync();
MoveAsync
public IAsyncAction MoveAsync(IStorageFolder destinationFolder);
public IAsyncAction MoveAsync(IStorageFolder destinationFolder, string desiredNewName);
public IAsyncAction MoveAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option);
OpenAsync
public IAsyncOperation<IRandomAccessStream> OpenAsync(FileAccessMode accessMode);
public IAsyncOperation<IRandomAccessStream> OpenAsync(FileAccessMode accessMode, StorageOpenOptions options);
OpenReadAsync
public IAsyncOperation<IRandomAccessStreamWithContentType> OpenReadAsync();
RenameAsync
public IAsyncAction RenameAsync(string desiredName);
public IAsyncAction RenameAsync(string desiredName, NameCollisionOption option);