Я видел что Google изменил свои разрешения.
Код: Выделить всё
Код: Выделить всё
string sGpath = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
// Crear la ruta completa del archivo
var folderPath = Path.Combine(sGpath, "GPV2");
photo.FileName = $ "{vf.IdVisita}_{DateTime.Now:yy_MM_dd_HH_mm_ss}.jpg";
string uniqueFileName = $ "{vf.IdVisita}_{DateTime.Now:yy_MM_dd_HH_mm_ss}.jpg";
string filePath = Path.Combine(folderPath, photo.FileName);
if (!Directory.Exists(folderPath)) {
Directory.CreateDirectory(folderPath);
}
using Stream sourceStream = await photo.OpenReadAsync();
Console.WriteLine($ "Archivo guardado en {filePath}");
vf.Titulo = uniqueFileName;
using(FileStream fileStream = File.OpenRead(filePath)) {
vf.Foto = ReadFully(fileStream);
}
/data/user/0/com.companyname. photov2/files/Pictures/GPV2/1_24_05_30_10_53_48.jpg
Даже если это не удерживает меня в галерее, как мне это сделать?
Подробнее здесь: https://stackoverflow.com/questions/785 ... y-net-maui