Trying to open a file, wrong format?
<p>Im trying to open a file. Here is my output (string i build up in try/catch):</p>

<p>Error opening c:\Program Files (x86)\MyApp\storedUsers.txt -> System.FormatException -> Input string was not in a correct format.</p>

<p>And here is how im opening it:</p>

<pre><code>installPath = @"C:\Program Files (x86)\MyApp\";
FileStream userFile = new FileStream(installPath + "storedUsers.txt", FileMode.OpenOrCreate, FileAccess.Read);
StreamReader userStream = new StreamReader(userFile);
while (userStream.Peek() &gt;= 0)
{
string line = userStream.ReadLine();
storedUsers.Add(line.Split(',')[0], int.Parse(line.Split(',')[0]));
}
userStream.Close();
</code></pre>

<p>My catch:</p>

<pre><code>WriteToLogFile("Error opening " + installPath + "storedUsers.txt -&gt; " + ex.GetType() + " -&gt; " + ex.Message);
</code></pre>

<p>I cant wrap my head around whats wrong...</p>
