Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var webResponse = webRequest.GetResponse();
- // If we get a response whose length exceeds int.MaxValue we'll happily throw an OverflowException here.
- byte[] output = new byte[(int)webResponse.ContentLength];
- using (var stream = webResponse.GetResponseStream())
- {
- stream.Read(output, 0, output.Length);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement