我收到一个我无法弄清楚的错误。我试过Google和SO,但无济于事......
这是我的代码:
for (int i = 0; i <= dctConvertedJSON.GetUpperBound(0); i++)
{
foreach (KeyValuePair<string, string> kvp in dctConvertedJSON(i))
{
string strKey = kvp.Key;
string strValue = kvp.Value;
Debug.WriteLine("Key: " + strKey.ToString + Constants.vbTab + " Value: " + strValue);
}
}
foreach
我在dctConvertedJSON
上收到的错误是:
Error: 'dctConvertedJSON' is a 'variable' but is used like a 'method'
我正在做什么(或不做)导致此错误?
答案 0 :(得分:4)
您应该将其更正为:
dctConvertedJSON[i]
所以代码是:
for (int i = 0; i <= dctConvertedJSON.GetUpperBound(0); i++)
{
foreach (KeyValuePair<string, string> kvp in dctConvertedJSON[i])
{
string strKey = kvp.Key;
string strValue = kvp.Value;
Debug.WriteLine("Key: " + strKey.ToString() + Constants.vbTab + " Value: " + strValue);
}
}