我第一次尝试使用匿名类型(测试):匿名类型作为方法的参数
private void button4_Click(object sender, EventArgs e)
{
test(new { a = "asd" });
}
private void test(string a)
{
}
我得到一个错误“无法从‘AnonymousType#1’转换为‘字符串’”
而且我'想知道如何通过匿名类型,如果参数是一个字符串[]
private void test(string[] a)
{
}
在此先感谢!
其实,我不想让你的答案,告诉我它应该看起来像使用匿名类型。 – 2009-05-21 18:28:27
约翰,检查在mquander的帖子中的链接。 – 2009-05-21 18:33:34