private void Button1_Click(object sender, System.EventArgs e)
{
this.paras("wwww","eeee","rrrr");
} public void paras(string [] str)
{
string temp="111";
for (int i=0;i<=str.Length;i++)
{
temp=temp+str[i];
}
this.Label1.Text=temp; }如何实现?

解决方案 »

  1.   

    public void paras( params string[] str)
      

  2.   

    方法很多
    可以用ArrayList
    也可以用String
    支持一楼
      

  3.   

    public void paras( params string[] str)
    对头.可以结贴了.
      

  4.   

    庆祝建军节楼上正解
    ====CSDN 小助手 V2.5 2005年11月05日发布====
    CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
    界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx
    下载:http://szlawbook.com/csdnv2
      

  5.   

    private void Button1_Click(object sender, System.EventArgs e)
    {
    this.paras(new string[]{"wwww","eeee","rrrr"});
    }public void paras(string [] str)
    {
    string temp="111";
    for (int i=0;i<=str.Length;i++)
    {
    temp=temp+str[i];
    }
    this.Label1.Text=temp;
    }
    ========================================
    LZ只是不知道如何传数组参数吧,如上即可