Advertisement
magnusbakken

Untitled

Jun 4th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1.             var webResponse = webRequest.GetResponse();
  2.  
  3.             // If we get a response whose length exceeds int.MaxValue we'll happily throw an OverflowException here.
  4.             byte[] output = new byte[(int)webResponse.ContentLength];
  5.             using (var stream = webResponse.GetResponseStream())
  6.             {
  7.                 stream.Read(output, 0, output.Length);
  8.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement