我第一次尝试使用匿名类型(测试):
private void button4_Click(object sender, EventArgs e)
{
test(new { a = "asd" });
}
private void test(string a)
{
}
我收到一个错误“无法从 'AnonymousType#1' 转换为 'string'”
如果参数是字符串[],我也想知道如何传递匿名类型
private void test(string[] a)
{
}
提前致谢!