- Регистрация
- 15.11.2020
- Сообщения
- 151
- Благодарностей
- 8
- Баллы
- 18
конверт кап в base64:
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string imageUrl = "https://i.ibb.co/WHWjbRy/image.png";
string capp = await GetBase64Image(imageUrl);
Console.WriteLine(capp);
}
static async Task<string> GetBase64Image(string imageUrl)
{
using (HttpClient client = new HttpClient())
{
byte[] imageBytes = await client.GetByteArrayAsync(imageUrl);
string base64Image = Convert.ToBase64String(imageBytes);
return base64Image;
}
}
}