我想返回一个值并从如下文本覆盖: item_type=etcitem 。我想通过这段代码返回值'etcitem':
var data = File
.ReadAllLines("itemdata.txt")
.Select(x => x.Split('='))
.Where(x => x.Length > 1)
.ToDictionary(x => x[0], x => x[1]);
textBox1.Text = data["item_type"];
但返回我错误:字典中不存在给定的键。
以下是一些行:
item_begin etcitem 6867 [rp_sealed_draconic_leather_gloves_i] item_type=etcitem slot_bit_type={none} armour_type=none etcitem_type=recipe recipe_id=666 祝福=0 weight=0 default_action=action_recipe consume_type=consume_type_stackable initial_count=1 maximum_count=1 soulshot_count=0 spiritshot_count=0
我做错了什么?谢谢