Assuming the text between those headers does not contain brackets you can do it this way:
Dictionary<String,String> content = new Dictionary<String,String>();
String text = @"[Header]
This is the header info for the file
[Body]This is the body information for the provided file and it contains many information for the file
[Summary]Summary for the file.";
foreach (String section in text.Split("[".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
String[] sectionParts = section.Split(']');
content.Add(sectionParts[0], sectionParts[1]);
}
The Dictionary
will contain the content of your File as header-text-pairs