Using the memorystream  
Author Message
Frank N White





PostPosted: Visual Basic General, Using the memorystream Top

Hi. I am wondering if there is a way I can load a text file into a memory stream and then edit the file and print the file without going back to my original file.


Visual Basic3  
 
 
nobugz





PostPosted: Visual Basic General, Using the memorystream Top

That's quite possible. However, the underlying storage for a MemoryStream is a Byte array. That is a very awkward type to have to use to do any text manipulations. Not to mention the need to dynamically grow, shrink and move bytes in the buffer as you insert or remove text. Consider a List(Of String) as an alternative.



 
 
Frank N White





PostPosted: Visual Basic General, Using the memorystream Top

Thanks a lot and with the list will I be able to then send it to a printer say using the printer IP address or will I need to do some sort of conversion before I do that


 
 
nobugz





PostPosted: Visual Basic General, Using the memorystream Top

You'll need to use the PrintDocument class to do the printing.