Konnichiwa to you too. ;)
I have a Windows Service that listens a certain port. When ASP .NET
application sends a message to the Windows Service, it starts to do batch
processing... Well, the reason I wanted to use MemoryStream was that I
wanted to encrypt the message and then send the message out to Windows
Service. I've been trying to do this, but I guess I took a wrong route... My
plan was...
(1) Encrypt the string and keep the encrypted string in memory.
(2) Create byte array out of the encrypted string.
(3) Write it into NetworkStream
(4) Listener receives it as byte array
(5) Construct encrypted string
(6) Decrypt it.
I haven't successfully been able to do this... Any suggestion?
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:#X**************@tk2msftngp13.phx.gbl...
Konichiwa Hayato,
Have you seen the MemoryStream? It works with byte arrays so you will
need to convert your string - which you can do with an Encoding.
[Untested]
Dim aBytes (Encoding.XXX.GetMaxByteCount) As Byte _
= Encoding.XXX.GetBytes (sString)
Dim strmMem As New MemoryStream (aBytes)
Where XXX is Unicode, or Ascii or whatever your string is.
If I may ask, what do you want to do with this Streamed string?
Regards,
Fergus.