Click here to Skip to main content
15,904,415 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi I have parameter name and parmeter value how can i set and get the param name and parm value sample below


[param name 1]=[value1]

[param name 2]=[value2]

[param name 3]=[value3]

[param name 4]=[value4]
Posted
Comments
bbirajdar 18-Jul-12 7:59am    
Unclear

1 solution

Why not use a Dictionary?
C#
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("my key", "my Value");
dict["my other key"] = "my other value";
Console.WriteLine(dict["my key"]);
Console.WriteLine(dict["my other key"]);




"Hi Griff thanks for your support .If i give multiple adds how can i loop to get the values"
C#
foreach (string key in dict.Keys)
   {
   Console.WriteLine(dict[key]);
   }
 
Share this answer
 
v2
Comments
lakshmichawala 18-Jul-12 8:35am    
Hi Griff thanks for your support .If i give multiple adds how can i loop to get the values
OriginalGriff 18-Jul-12 9:42am    
Answer updated

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900