79758296

Date: 2025-09-07 18:47:49
Score: 3.5
Natty:
Report link

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 ?

Reasons:
  • RegEx Blacklisted phrase (2): Any suggestion
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: olivier Goossens Bara