static async Task SaveFileAsync(int i, string url) { byte[] fileBytes = await _http.GetByte(url); string fileName = Path + "\\" + PrintByteArray(fileBytes) + ".jpg"; //using (FileStream fs = new FileStream(fileName, FileMode.Create)) //{ // await fs.WriteAsync(fileBytes, 0, fileBytes.Length); //} await File.WriteAllBytesAsync(fileName, fileBytes); MemoryManagement.FlushMemory(); }