将数组作为参数传递给另一个

Lea*_*ner 1 c# c#-4.0

我有一个代码段.我想传递msg_arr作为参数,数组名称是msg_arr

这是我的尝试1,但变得很恐怖

 private void check(string keyword params arr[] msg_arr )
    {
        switch (keyword.ToUpper())
        {
            case  "SETTELG":
                Response.Redirect("../SMSFunction/SeenSMS.ascx?value=1&arr" + msg_arr);

                break;
Run Code Online (Sandbox Code Playgroud)

这是我的尝试2,也是错误

 private void check(string keyword string msg_arr[] )
    {
        switch (keyword.ToUpper())
        {
            case  "SETTELG":
                Response.Redirect("../SMSFunction/SeenSMS.ascx?value=1&arr" + msg_arr);

                break;
Run Code Online (Sandbox Code Playgroud)

ale*_*exn 5

好吧,你在参数之间缺少一个逗号:

private void check(string keyword, params arr[] msg_arr)
Run Code Online (Sandbox Code Playgroud)

如果不是这样,请发布整个代码和实际的错误消息.一个好主意是阅读有关参数文档.