code_junkie

How to avoid File Blocking

Nov 11th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. using (var st = new FileStream(MenifestPath, FileMode.Open, FileAccess.Read))
  2. {
  3. using (TextReader r = new StreamReader(st))
  4. {
  5. var xml = r.ReadToEnd();
  6. r.Close();
  7. st.Close();
  8. //................ Rest of our operations
  9. }
  10. }
  11.  
  12. string xmlText = File.ReadAllText(ManifestFile);
Add Comment
Please, Sign In to add comment