C# C# Streams and Data Processing Streaming Data on the Net WebClient

Stephen Mooney
Stephen Mooney
2,460 Points

Stream I keep getting told i did not pass stream into streamreader, but i clearly did

using System; using System.IO; using System.Net;

namespace Treehouse.CodeChallenges { class Program { static void Main(string[] args) { Console.WriteLine(GetTreehouseHome()); }

    public static string GetTreehouseHome()
    {
        string treehouse = "";
       using(var webClient = new WebClient()){

             byte[]  treehouseBytes =  webClient.DownloadData("https://www.teamtreehouse.com");

              using(var stream = new MemoryStream(treehouseBytes))
              using(var reader = new StreamReader (stream)){


              }
       }

        return treehouse;
    }
}

}

Program.cs
using System;
using System.IO;
using System.Net;

namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(GetTreehouseHome());
        }

        public static string GetTreehouseHome()
        {
            string treehouse = "";
           using(var webClient = new WebClient()){

                 byte[]  treehouseBytes =  webClient.DownloadData("https://www.teamtreehouse.com");

                  using(var stream = new MemoryStream(treehouseBytes))
                  using(var reader = new StreamReader (stream)){


                  }
           }

            return treehouse;
        }
    }
}