Does anybody knows the different between Key and _key in the List<> and Dictionary, how to approach them and manipulate them?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
From your question and examples, I'm guessing you are enumerating a collection of DictionaryEntry
structures. If that is the case, _key
is a private member variable and Key
is a public property. You can access Key
from your code because it is public, but not _key
because it is private.
The debugger is able to show you both values via reflection. You should only use the Key
property in your code.