CSL_Test__1.TorrentBuilder.GetTorrentBirth C# (CSharp) Method

GetTorrentBirth() public method

public GetTorrentBirth ( FileInfo file ) : string
file System.IO.FileInfo
return string
        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;
        }

Same methods

TorrentBuilder::GetTorrentBirth ( string file ) : string