Hello,
It is recommended to use Media picker to pick photos.
This article describes how you can use the .NET Multi-platform App UI (.NET MAUI)
IMediaPicker
interface. This interface lets a user pick or take a photo or video on the device.
Update:
You could add a Helper
class into your Platform\Android
folder to get all files from "/storage/emulated/0/Pictures"
.
public static class Helper
{
public static string[] files_help()
{
var dir = Environment.GetExternalStoragePublicDirectory(Environment.DirectoryPictures);
var files = Directory.GetFiles(dir.AbsolutePath, "*");
return files
}
}
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.