Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 17th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Does XPathDocument use the memory stream it is constructed with after construction?
  2. // Take the xml message and turn it into an object
  3. var bytes = Encoding.ASCII.GetBytes(message);
  4. var memoryStream = new MemoryStream(bytes);
  5.  
  6. XPathDocument xPathDocument = new XPathDocument(memoryStream);
  7.        
  8. // Take the xml message and turn it into an object
  9. var bytes = Encoding.ASCII.GetBytes(message);
  10. var memoryStream = new MemoryStream(bytes);
  11.  
  12. XPathDocument xPathDocument = null;
  13. using(memoryStream)
  14. {
  15.     XPathDocument xPathDocument = new XPathDocument(memoryStream);
  16. }