I have a foreach loop in C # that returns some inventory data, the property is location_idreturned as object[]. cycle as follows:
foreach (XmlRpcStruct item in result)
{
object obj = item["location_id"];
}
in the debugger, I see the object as follows:

so I think the object is something like
obj[0] = 12
obj[1] = "WH/Stock"
I tried to access objhow obj[0], then I get
Cannot apply indexing with [] to an expression of type 'object'
So, how can I access an object by index to get values like 12andWH/Stock
source
share