writing data to a file with the result is not as expected
<p>I use this code to write a string to a file.</p>

<pre><code>var fs = File.Open(path, FileMode.OpenOrCreate, FileAccess.Write);
var sw = new StreamWriter(fs, Encoding.UTF8);
sw.Write(dataString);
fs.Flush();
sw.Flush();
sw.Close();
</code></pre>

<p>When I debug it, I see the dataString correct. However, after writing to a file, there are some strings have wrong orders. Should I add a thread Sleep after writing data to the file because right after writing data to the file, I read it back for other process.</p>

<p>OR probably there is better way to write a string to a file?</p>

<p>Thanks in advance.</p>
