两个重载
public int MyFun(params string[] values)
public int MyFun(string a,string b)调用时如果MyFun(c,d)
c,d都为string如何指定使用哪个重载,谢谢!
public int MyFun(params string[] values)
public int MyFun(string a,string b)调用时如果MyFun(c,d)
c,d都为string如何指定使用哪个重载,谢谢!
解决方案 »
- C#操作Word 横向显示要怎么办
- Stream.write
- 如何提高远程桌面截图的清晰度
- 打开网页
- 有谁知道在javascript里面如何调用 .cs里面的函数?
- 请版主和高手兄弟介绍一下commerce server,随时在线等待!
- 如何实现VS2005 C# 的SQL数据库更新???
- 如何在Windows Form程序中,嵌入word文档?
- 如何在程序中设置打印机的选项(如:自定义纸张大小,纸张来源,打印方向,纸张输出大小等)???
- 关于网页html编码的问题,
- 怎么用c# 做一个 c# Microsoft Management Console 程序?
- 请教如何在C.net中返回xml串?谢谢!
要指定,可以把c,d保存到一个string[]字符数组里,比如str,在MyFun(str),就可以了
因为第一个函数的第二个参数是数组类型的,而不是字符串的。只有超过了三个参数的才会调用第一个函数:public int MyFun(params string[] values)
Supported by the .NET Compact Framework. Console.WriteLine (String, Object, Object) Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
Supported by the .NET Compact Framework.
Console.WriteLine (String, Object, Object, Object) Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
Supported by the .NET Compact Framework.
Console.WriteLine (String, Object, Object, Object, Object) Writes the text representation of the specified objects and variable-length parameter list, followed by the current line terminator, to the standard output stream using the specified format information. 楼上能否解释一下为什么Console.WriteLine要提供多个重载 而不是只提供一个param Object[]