The error message tells you all.
either you try to access a place after the end of the array, either the array is shorter than expected which is more or less the same thing.
you say that the error is there:
string inputParam = parts[1].Substring(14);
replace this line with:
string Temp = parts[1];
string inputParam = Temp.Substring(14);
and see where it fails.
Use the debugger to see the values of variables when it fail.
Update
Hi Tom,
Looks like you let me a comment that have been deleted.
To get answers that fit your question, don't put the error message in title and remove the sentence after code.
Both are secondary effect of your real problem and they are misleading.
Your code is also related to the error message.
Focus on the problem.