I think the easiest approach is just to change the last line to
txtBlock.Text = await response.Content.ReadAsStringAsync(); //right!
This way you don’t need to introduce any stream readers and you don’t need any extension methods.
More Related Contents:
- CS0120: An object reference is required for the nonstatic field, method, or property ‘foo’
- Distinct() with lambda?
- Is the C# static constructor thread safe?
- How to create a simple proxy in C#?
- How to read data of an Excel file using C#?
- converting a base 64 string to an image and saving it
- Headless browser for C# (.NET)? [closed]
- WebDriverWait is not waiting for the element I specify
- LINQ To Entities does not recognize the method Last. Really?
- Replace only some groups with Regex
- Send a File to the Recycle Bin
- Self referencing loop detected – Getting back data from WebApi to the browser
- Incorrectly aligned or overlapped by a non-object field error
- Copy Arrays to Array
- How do I import from Excel to a DataSet using Microsoft.Office.Interop.Excel?
- How can user resize control at runtime in winforms
- Is there a tool for finding unreferenced functions (dead, obsolete code) in a C# app? [closed]
- Timer, event and garbage collection : am I missing something?
- How to deserialize a unix timestamp (μs) to a DateTime from JSON?
- Does C# support multiple inheritance?
- DbContext discard changes without disposing
- Does C# 7.0 work for .NET 4.5?
- Skip null values with custom resolver
- Find all files in a folder
- Could not load file or assembly ‘System.Web.Helpers, error on IIS 8
- How to call back async function from Rx Subscribe?
- Reading specific XML elements from XML file
- Where is the .NET JIT-compiled code cached?
- Is it wrong to use the Dispatcher within my ViewModel?
- parsing an enumeration in JSON.net