问题描述
我想使用一个具有多个值的键.例如,
键:CString
值1:CString
值2:Int
值3:Float
值4:CString
如果我传递了任何重复的密钥,则必须重写,例如已经存储了一个名为"Car"的密钥.如果我尝试再次存储相同的密钥名称和不同的值,则必须重写.请帮助我..在此先感谢
I want to use one key with multiple values. For example,
Key: CString
Value1: CString
Value2: Int
Value3: Float
Value4: CString
If i pass any duplicate key it has to overwrite for example already i stored a key called "Car" If i try to store again the same key name and different values it has to overwrite. Plz help me.. Thanks in advance
推荐答案
public class Vehical
{
string key=string.Empty;
string value1=string.Empty;
int value2=0;
string value3=string.Empty;
string value4=string.Empty;
}
现在使vehical类的列表对象
喜欢,list<vehical> obj;
您可以使用此和lamda表达式添加,更新,删除,查找等更多内容.
希望这项工作对您有帮助...
And now make list object of class vehical
like,list<vehical> obj;
you can add,update,delete,find and many more using this and lamda expression.
hopes this work for u...
这篇关于一键多值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!