Reading from memory stream to string
If you’d checked the results of stream.Read, you’d have seen that it hadn’t read anything – because you haven’t rewound the stream. (You could do this with stream.Position = 0;.) However, it’s easier to just call ToArray: settingsString = LocalEncoding.GetString(stream.ToArray()); (You’ll need to change the type of stream from Stream to MemoryStream, but that’s okay … Read more