小编Jdo*_*dog的帖子

为什么不将"as something.GetType()"转换为有效?

此代码导致错误:type or namespace "index" could not be found.

foreach (var index in Model.UserAssets.Keys)
{
    foreach (var asset in Model.UserAssets[index])
    {
        var val = asset as index.getType();
    }
}
Run Code Online (Sandbox Code Playgroud)

为什么这不起作用?是因为index不在范围内(虽然它应该是)?

c# casting

0
推荐指数
1
解决办法
118
查看次数

标签 统计

c# ×1

casting ×1