I've tried this method for .NET Android 11
if (Environment.IsExternalStorageManager)
{
//todo when permission is granted
}
else
{
//request for the permission
Intent intent = new Intent(Settings.ActionManageAppAllFilesAccessPermission);
Uri uri = Uri.FromParts("package", PackageName, null);
intent.SetData(uri);
StartActivity(intent);
}
NOW, I'm finaly able to read a file without access denied
BUT I have to already know the name of the file :
"00-096-20250907-162117-50020-4ac3d737d8320703.jpg"
Java.IO.File FFF = new Java.IO.File(App._PhotoPath, "00-096-20250907-162117-50020-4ac3d737d8320703.jpg");
var uuu= File.ReadAllBytes(FFF.AbsolutePath);
And App._Photopath is
/storage/emulated/0/Pictures/BelcoPict/
Unfortunately I can not get a list of the file in the directory
files = Directory.GetFiles(sPath, sFilter);
Return empty array
Any suggestion ?