Introduction
If you want to get the exact idea about How to Request a Web Page and Retrieve the Results as a Stream, you must have enough knowledge about all functions of stream. Using stream is a genuine approach to send and receive Web data. Your application can use Stream.Write to send data and can use and Stream.Read to receive data from the web files written in XML, HTML, or anything else, and for this requirement, you must have a sound web connection. Generally, Streams are utilized throughout the .NET Framework, which has sufficient infrastructure co control them throughout different network connection.For the following steps, you need to insert References to the ‘System.IO and System.Net namespaces
Step #1
First you need to set a variable for the new WebClient on which you’re going to develop this application.Step #2
Stream response is used to read data from the webClient URL https://technologycrowds.com/ through myClient.OpenRead().Step #3
Now you have close the response stream by the response.Close() method.Step #4
Now it’s time to compile the code and retrieve the result.
Please note that you can follow web request method before proceeding to the above steps.
Hope, you must have a better idea about How to Request a Web Page and Retrieve the Results as a Stream.
var myClient = new WebClient(); Stream response = myClient.OpenRead("https://technologycrowds.com/"); // The stream data is used here. response.Close();
Post A Comment:
0 comments: