Answer the question
In order to leave comments, you need to log in
Is it possible to do this in Dictionary?
Hello ! (Forgive me if I somehow explained it wrong, I'm just studying Dictionary) Is it possible to do this in Dictionary:
var dictionary = new new Dictionary<string, int>{
{"Файл" , 1 , File.png} // "имя ячейки" , "Стоимость" , "Сам файл который пользователь получает при его покупки"
}
Answer the question
In order to leave comments, you need to log in
No. A dictionary is a Key, Value list. If you need to store several values by key, then create, for example, a structure and store it as value.
public struct MyStruct
{
public int ID;
public string FIleName;
}
MyStruct myFile = new MyStruct();
myFile.ID = 1;
myFile.FileName = "File.png";
var dictionary = new Dictionary<string, MyStruct> {
"Файл1" , myFile
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question