Parsing Key Value Pairs

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

What is the best way to parse keys and their values from a http
repsonse (byte array?) I'd like to keep it as generic as possible as I
have many repsonses to parse.

Any thoughts would be appreciated.

Greg.
 
Need more background information about your app.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
 
Thanks Kevin,

dont worry, I've just written a class to do it. I had to do a very
through job, since it is going to be used in several apps. The reason
why I asked was I was wondering if Microsoft had supplied a class that
did it for us.

What I wanted was to be able to separate values for their corresponding
key from a string e.g.

"sidjsidjsidjisdjsiasdjakjaksj?key1=value1&key2=value2&key3=value3"
 
Ah. About the only way I know to do this is with the good ol' fashioned
String.Split.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
 
Back
Top