Не могу получить string из Stream - C#

Узнай цену своей работы

Формулировка задачи:

try
                        {
                            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Config._url);
                            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                            Stream stream = response.GetResponseStream();
                            using (StreamReader sr = new StreamReader(stream))
                            {
                                Console.WriteLine(sr.ReadToEnd());
                                command = Crypt.Decrypt(sr.ReadToEnd(), Config.PassCrypt);
                            }
 
                            Console.WriteLine("command: "+command);
                            if (command.Length > 0)
                            {
                                if (command != sOldCommand)
                                {
                                    _commandService.ExecuteCommand(command);
                                    sOldCommand = command;
                                }
                            }
                            else
                            {
                                _commandService.ExecuteCommand("stop");
                                sOldCommand = string.Empty;
                            }
                        }
                        catch (Exception) { }
Вот в этом куске кода:
Stream stream = response.GetResponseStream();
                            using (StreamReader sr = new StreamReader(stream))
                            {
                                Console.WriteLine(sr.ReadToEnd());
                                command = Crypt.Decrypt(sr.ReadToEnd(), Config.PassCrypt);
                            }
Не работает присваивание строки command значения из sr. Интересно но в консоль выводятся данные а в строку нет. Что делать?

Решение задачи: «Не могу получить string из Stream»

textual
Листинг программы
                            using (StreamReader sr = new StreamReader(stream))
                            {
                                string responseText = sr.ReadToEnd();
                                Console.WriteLine(responseText);
                                command = Crypt.Decrypt(responseText, Config.PassCrypt);
                            }

Оцени полезность:

15   голосов , оценка 3.667 из 5