This has nothing to do with "moving to the next line" - it's too do with the data you read.
string[] parts = line.Split(new[] { "|" }, StringSplitOptions.None);
Messagetype.Add(parts[1]);
When the line you read does not contain any "|" characters then the Split method returns an array containing only one element. So when you try to access the element at index one, it doesn't exist and you get an error.
So start by checking your text file, and see why it has a line which doesn't have any "|" characters.
If that is expected, then check it inside your loop:
string[] parts = line.Split(new[] { "|" }, StringSplitOptions.None);
if (parts.Length > 1)
{
Messagetype.Add(parts[1]);
}