خرید بک لینک

Vote count: 0

I have a Dictionary<string, Delegate> commands with my delegate taking two strings and a string[] as params.

I'm entering a command in a Console Application:

:adduser useame email@email.com Firstname Middlename Lastname

where everything is converted to an array of strings (size 6). I then do

list[3] = string.Join(" ", input, 3, 3);
list.RemoveRange(4, list.Count - 4);

to convert Firstname, Middlename, and Lastname into a single string, so that my array looks like this:

input[0]: :adduser

input[1]: :useame

input[2]: :email@email.com

input[3]: :Firstname Middlename Lastname

I then try to call commands[input[0]].Method.Invoke(this, list.Skip(1).ToArray<object>());, but it results in an ArgumentException with the message

Object of type 'System.String' caot be converted to type 'System.String[]'.

I'm a bit lost, as I don't really know what's wrong. I'd appreaciate any help!

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 29 فروردين 1395 ساعت: 6:43

صفحه بندی