方法一:params 参考MSDNhttp://msdn.microsoft.com/zh-cn/library/w5zay9db(v=vs.80).aspx方法二:将参数封装为一个对象方法三: public static void MsgFounction(string username,bool isChina=true) { Console.WriteLine(string.Concat(username, ":", isChina)); }设置方法参数默认值,调用时:MsgFounction("张三");MsgFounction("aa Read More
posted @ 2013-01-12 15:28 一抹、思乡泪 Views(379) Comments(0) Diggs(0) Edit