Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(path);

path is string for example c:\\myImages\\wedding
i am not able to fetch the folder using the specified code..??
getting error "Access is Denied"??
please help me out



also i want to fetch all the image files in specified path folder?
IAsyncOperation<storagefile> fileList = StorageFile.GetFileFromPathAsync(path);
this isn't providing me any solution......
Posted
Updated 8-Oct-12 17:54pm
v3
Comments
Sergey Alexandrovich Kryukov 9-Oct-12 0:05am    
Which part of "access is denied" is not clear?
--SA

1 solution

Isn't this obvious? Your application does not have enough privileges to access the file. The path name "c:\myImages\wedding" (not "c:\\myImages\\wedding"!) is normally illegal path for the user mode. Of course, the user can always run your application as administrator, or change the file system permission for some object, but this is just not right way of doing things. Rather, you should use legal directories for your work, those predefined for each user's account of for "all users".

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Oct-12 1:24am    
[OP commented:]

@Alexandrovich : so you are telling that i should replace c:\\myimages\\wedding with c:\myImages\wedding???
Sergey Alexandrovich Kryukov 9-Oct-12 1:27am    
No! I just pointed out that your "c:\\myimages\\wedding" is not the real value of the string; "\\" is just the C++ escape of '\'; so the initialization someString = "c:\\myimages\\wedding" gives you the value "c:\myimages\wedding".

Please don't post such comments as "solutions"; they will be removed, no one receives notifications.
--SA
Punjabi Nikki 9-Oct-12 1:50am    
so may i know why i am not able to get the storageFolder from path??
Sergey Alexandrovich Kryukov 9-Oct-12 9:53am    
Most likely, due to access to the directory, as I explained. You can see it by yourself.
Is the lack of your access a reason to vote 2, I wonder? :-)
Do right thing; and you'll be all right.
--SA

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