Hi,
It is not exactly possible the same way as you have shown in JavaScript.
If you want to store an array of multiple type objects, then probably you
need something like an ArrayList.

However, if you want to know how to add properties dynamically to an object,
it gets a bit complex.
Here is a VB.Net example at:
http://coding-passion.blogspot.com/2008/12/adding-properties-to-object-dynamically.html
that
you may want to check out.

Regards,
Kaarthik

On Tue, Dec 9, 2008 at 4:52 PM, Edgard Matos <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Do you know how to create dinamic properties in C# Objects?
>
> In JavaScript I create like this:
> *var obj = new Object();*
> *obj["propOne"] = "test";*
> *obj["propTwo"] = new Array();*
>
> I need to access directly properties using Object["prop"]
> How do I do this with C#?
>
> Very thanks!
>
>
> Edgard Matos
> E-mail: [EMAIL PROTECTED]
>



-- 
Kaarthik,
http://coding-passion.blogspot.com

Reply via email to