public string GetTorrentBirth(FileInfo file)
{
string value;
FileStream fs = null;
StreamReader sr = null;
try
{
fs = file.OpenRead();
sr = new StreamReader(fs);
string fileContents = sr.ReadToEnd();
value = null;
if (fileContents.Contains("waffles"))
value = "waffles";
else if (fileContents.Contains("what"))
value = "what";
}
catch(Exception e)
{
ew.IssueGeneralWarning("Error reading from torrent file", "Please report", e.Message + "\n" + e.StackTrace);
value = null;
information[14] = "true";
}
finally
{
if(fs != null)
fs.Dispose();
if(sr != null)
sr.Dispose();
}
if (value == null)
return IssueError("Can't parse birth", file);
else
return value;
}