Questions tagged [storagefile]

The StorageFile class represents a file in Windows Store apps. It provides information about the file and its content, and ways to manipulate them

The StorageFile class represents a file in Windows Store apps. It provides information about the file and its content, and ways to manipulate them.

Details on the StorageFile can be found at: http://msdn.microsoft.com/library/windows/apps/BR227171

146 questions
12
votes
2 answers

The component cannot be found. (Exception from HRESULT: 0x88982F50)

The above exception occurs at line await bitmapImage.SetSourceAsync(fileStream); whenever I tried to retrieve image from local file. This is the method I'm using for storing and retrieving the image file. public async Task
MohanRajNK
  • 895
  • 2
  • 13
  • 26
9
votes
3 answers

WinRT StorageFile write downloaded file

I'm struggling with a easy problem. I want to download an image from web using this code: WebRequest requestPic = WebRequest.Create(@"http://something.com/" + id + ".jpg"); WebResponse responsePic = await requestPic.GetResponseAsync(); Now I wanted…
Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
7
votes
3 answers

c# UWP Save StorageFile Without Dialog

I am in trouble with some issue about FileSavePicker. Is there any solution about saving a StorageFile without showing any popup or dialog to ask user. I want to give the current path of the storage file from code behind. var byteArray =…
alidrsn
  • 109
  • 1
  • 10
7
votes
1 answer

Storage file to System uri?

I have a Windows Metro app written in c#. Here is the code I am using to pick a file from a local music library: FileOpenPicker openPicker = new FileOpenPicker(); openPicker.ViewMode = PickerViewMode.Thumbnail; openPicker.SuggestedStartLocation =…
Hendra Anggrian
  • 5,780
  • 13
  • 57
  • 97
6
votes
3 answers

How delete file in localstorage on winrt?

i try whithout success to delete a file in my local storage. Exactly, i took a photo and i want to delete it later with a button for exemple. But when i click on the button, the app bugs and i have : "access denied". I sude a simple Delet.Async()…
Sw1a
  • 245
  • 4
  • 15
6
votes
5 answers

Access Denied when deleting image file previously used in DataTemplate in WinRT

I have image (PNG) files used by my GridView as part of its DataTemplate. If I try to delete a specific object row in my GridView, I would delete the related image file for that row as well. The images are different for every item on the list. I'm…
4
votes
0 answers

"Value does not fall within the expected range" exception when fetching json file using GetFileFromApplicationUriAsync

I have a json file in one of the folder of source code which was being fetched using GetFileFromApplicationUriAsync function of StorageFile class of C#. This code was working until latest security patch was installed (03 March 2019). Below is the…
4
votes
1 answer

How do you assign a storage file to a ByteArray?

How can I assign a storage file to a ByteArray? var file = await openPicker.PickSingleFileAsync();
Terry Bennett
  • 125
  • 1
  • 11
4
votes
1 answer

Cannot implicitly convert type IAsyncOperation to StorageFile

What the hell is wrong with my code? private void BrowseButton_Click(object sender, RoutedEventArgs e) { FileOpenPicker FilePicker = new FileOpenPicker(); FilePicker.FileTypeFilter.Add(".exe"); FilePicker.ViewMode =…
gabrieljcs
  • 689
  • 6
  • 13
4
votes
2 answers

An elegant / performant way to "Touch" a file in (update ModifiedTime) in WinRT?

An elegant / performant way to "Touch" a file in (update ModifiedTime) WinRT? I have some code which needs to delete files that are older than 30 days. This works well, but in some cases, I need to update the time on the file to reset the 30 day…
Jon Rea
  • 9,337
  • 4
  • 32
  • 35
3
votes
1 answer

UWP StorageFile file in use by another process errors

The data for my app is stored in local JSON. I was originally storing it as an string app setting, but that doesn't offer enough space. So, I'm updating my app to read/write from a JSON file in local storage. My app reads and writes the JSON at…
Scott
  • 1,011
  • 1
  • 15
  • 30
3
votes
1 answer

CreateFileAsync creates blocked file

I'm working on a UWP app that needs to create a file outside of local storage. I use a folder picker to let the user select the output director, then I store that selection using LocalSettings and add the folder to the FutureAccessList. Then, I use…
Johnie Karr
  • 2,744
  • 2
  • 35
  • 44
3
votes
2 answers

Windows RT - synchronous usage of StorageFile

I want to write a Win8 app, there I use a Configuration-class with a static member, which is loaded once at startup and can be accessed from everywhere at runtime. So, the main problem is, the default settings are stored within an xml file, but…
Michael Dietrich
  • 451
  • 1
  • 5
  • 17
3
votes
1 answer

CreateStreamedFileFromUriAsync: How can i pass a IRandomAccessStreamReference?

I am trying to download a file using StorageFile method CreateStreamedFileFromUriAsync but i am confused with IRandomAccessStreamReference parameter. How can I pass a IRandomAccessStreamReference? It is an interface. What sould I do? public static…
Olcay Ertaş
  • 5,987
  • 8
  • 76
  • 112
3
votes
1 answer

StorageFolder.GetFilesAsync() method with a search pattern?

In the regular .NET Framework, there are a number of methods for retrieving a subset of files in a directory based on a search pattern, for example DirectoryInfo.GetFiles(string searchPattern). Is there a corresponding method for Windows Store…
Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114
1
2 3
9 10