Guest User

Untitled

a guest
Jul 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. response = (HttpWebResponse)request.GetResponse();
  2. reader = new StreamReader(response.GetResponseStream());
  3. String streamedXML = reader.ReadToEnd(); //
  4. XmlDocument doc = new XmlDocument();
  5. doc.LoadXml(streamedXML);
  6.  
  7. Unexpected end of file has occurred. The following elements are not closed:
  8.  
  9. using (var client = new WebClient())
  10. {
  11. string streamedXML = client.DownLoadstring(sourceUrl);
  12. ...
  13.  
  14. }
  15.  
  16. using(response = (HttpWebResponse)request.GetResponse())
  17. using(reader = new StreamReader(response.GetResponseStream()))
  18. {
  19. String streamedXML = reader.ReadToEnd(); //
  20. XmlDocument doc = new XmlDocument();
  21. doc.LoadXml(streamedXML);
  22. }
Add Comment
Please, Sign In to add comment