Why do I get Stream as System.IO.UnmanagedMemoryStream?

I have a piece of code like this

        Assembly myAssembly = Assembly.GetExecutingAssembly();
        string[] names = myAssembly.GetManifestResourceNames();
        foreach (string file in names)
        {
            if (file.EndsWith(".dtd"))
            {
                // attach to stream to the resource in the manifest
                  dtdStream = myAssembly.GetManifestResourceStream(file);
                  MessageBox.Show(dtdStream.ToString());
            }                
        }

I have all the dtd files in the My Resources folder. It has a built-in resource like assembly.
Now when I debug the code, I get a window with the message System.IO.UnmanagedMemoryStream

But I want a Managed MemoryStream?
What is wrong in my code?
Thanks...

+3
source share
2 answers

(EXE DLL), , , . , GetManifestResourceStream, ( UnmanagedMemoryStream).

, ? MemoryStream UnmanagedMemoryStream , () , .

+8

Source: https://habr.com/ru/post/1709231/


All Articles