string GetSlnFileVersion(string strInSlnFile, out string headerComment)
{
string strVersion = null;
string strInput = null;
headerComment = null;
Match match;
StreamReader reader = new StreamReader(strInSlnFile);
strInput = reader.ReadLine();
if (strInput == null)
return null;
match = SlnVersionRegex.Match(strInput);
if (!match.Success) {
strInput = reader.ReadLine();
if (strInput == null)
return null;
match = SlnVersionRegex.Match (strInput);
}
if (match.Success)
{
strVersion = match.Groups[1].Value;
headerComment = reader.ReadLine ();
}
// Close the stream
reader.Close();
return strVersion;
}