【发布时间】:2019-02-25 03:02:10
【问题描述】:
我已经迭代了
foreach (var tmp_variable in all_subdirectories)
{
MessageBox.Show(tmp_variable["Name"]);
}
我想在 tmp_variable 中打印 Name。
在“自动”选项卡中(调试变量值时),tmp_variable 具有以下值: tmp_variable { 路径 = "D:\abc\folder1", 名称 = "folder1" }
但无法使用任何此类东西。
我试过写
MessageBox.Show(tmp_variable[Name]);
和,
MessageBox.Show(tmp_variable.Name);
但是没有任何效果。一切都显示错误。
【问题讨论】:
-
请不要发布错误消息的截图(阅读:Pictures of exceptions are not helpful)。