Reading values from NameObjectCollectionBase

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I've written some code that reads the names and values from a
Collections.Specialized.NameValueCollection and displays them on the screen.

However, I'd ideally like to change this code so that it runs against the
abstract Collections.Specialized.NameObjectCollectionBase class, so that all
collections that derive from this base class (which includes
NameValueCollection) will work with my code.

I can extract the keys that have been used to add items to the collections
using the Keys() property which is implemented in the base class, but there
is no similar method to extract the values that are associated with the
keys. As the class appears by definition to hold matching pairs of names
(keys) and values, I would have thought there would be a way to obtain the
values themselves.

Can anyone shed any light on this?

Thanks in advance,

--

(O)enone


.



Relevant Pages

  • Re: Reading values from NameObjectCollectionBase
    ... However, I'd ideally like to change this code so that it runs against the abstract Collections.Specialized.NameObjectCollectionBase class, so that all collections that derive from this base class will work with my code. ... I can extract the keys that have been used to add items to the collections using the Keysproperty which is implemented in the base class, but there is no similar method to extract the values that are associated with the keys. ... As the class appears by definition to hold matching pairs of names and values, I would have thought there would be a way to obtain the values themselves. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: is this data structure build-in or Ill have to write my own class?
    ... maintain the order (for iter and print) ... I was thinking having a base class like Bunchhttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308and on ... top of that keeping a list of the keys and pop/push to the list when ... which is a mapping type with identically sorted ...
    (comp.lang.python)
  • Re: keytab, kvno, ktadd, and existing tickets
    ... ktadd does not "extract" keys. ... kvno changes is a side issue -- what breaks you is that the keys ... extract keys without changing them. ...
    (comp.protocols.kerberos)
  • Re: New to this type of XML page
    ... How can I extract the "data from the 6 Keys for that device? ... process all those MeanPublic elements and output the First values? ... here is the xml file I ...
    (comp.text.xml)
  • grep or fgrep ?
    ... Have dozens of files in a folder and want to extract the following: ... what to extract and search string "Keys" ...
    (Ubuntu)