Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi!
How can i access file in Windows store app not using the FileOpenPicker control.
Like this in c#:
C#
string [] filelist = Directory.GetFiles(@"d:\");
FileStream fs = new FileStream(@"D:\ab.jpg", FileMode.OpenOrCreate, FileAccess.ReadWrite);
FileStream fs2 = new FileStream(filelist[0], FileMode.OpenOrCreate, FileAccess.ReadWrite);

Thank you!
Posted
Updated 9-Apr-14 10:27am
v2
Comments
[no name] 9-Apr-14 16:50pm    
http://www.bing.com/search?q=access+file+in+Windows+store+app

1 solution

I think you can try accessing options under the LocalFolder under your appData. For example there are methods like CreateFile, GetFileAsync, OpenFileAsync etc.

await ApplicationData.Current.LocalFolder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);


Try using GetFileAsync and based whether you get a valid o/p or hit exceptions you can move forward with what you want to do.
Do check http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.aspx[^] for more information on Application Data
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900