?
....
Hi
I have an existing function which has a stream object (inmsg.BodyPart.Data).
I'm trying to search and replace the stream object in the most efficient way
possible
This is my attempt below, however I'm getting a message on the last line
that I can't convert a memorystream to a stream. Any hints, or better ways
of doing this?
Thanks in advance
StreamReader ms = new StreamReader(inmsg.BodyPart.Data);
string content = string.Empty;
content = ms.ReadToEnd();
content = content.Replace("HELLO","GOODBYE");
content = content.Replace("YES","NO");
inmsg.BodyPart.Data = ms;
I have an existing function which has a stream object (inmsg.BodyPart.Data).
I'm trying to search and replace the stream object in the most efficient way
possible
This is my attempt below, however I'm getting a message on the last line
that I can't convert a memorystream to a stream. Any hints, or better ways
of doing this?
Thanks in advance
StreamReader ms = new StreamReader(inmsg.BodyPart.Data);
string content = string.Empty;
content = ms.ReadToEnd();
content = content.Replace("HELLO","GOODBYE");
content = content.Replace("YES","NO");
inmsg.BodyPart.Data = ms;