.NET 4.x Не удается неявно преобразовать тип "int" в "byte" - C#
Формулировка задачи:
Помогите решить ошибку.
ругается на эти строчки
private byte[] GetIV()
{
byte[] IV = new byte[16];
byte[] TimeStart = BitConverter.GetBytes(StartTime);
for (int i = 0; i < 16; i++)
{
IV[i] = ((i< 4) ? TimeStart[i] : 99);
}
return IV;
}
private byte[] GetAesKey()
{
byte[] Bytes = Encoding.UTF8.GetBytes(BotDetectKey);
byte[] BArr = new byte[16];
int len = (Bytes.Length > 16) ? 16 : Bytes.Length;
for (int i = 0; i < 16; i++)
{
BArr[i] = ((i < len) ? Bytes[i] : 0);
}
return BArr;
}IV[i] = ((i< 4) ? TimeStart[i] : 99); BArr[i] = ((i < len) ? Bytes[i] : 0);
Решение задачи: «.NET 4.x Не удается неявно преобразовать тип "int" в "byte"»
textual
Листинг программы
IV[i] = ((i< 4) ? TimeStart[i] : (byte)99); BArr[i] = ((i < len) ? Bytes[i] : (byte)0);