Post

PipeMessage.EncodeString

Encodes a string into MsgData and sets MsgCode to '0'.


Remarks

Any MsgData already in the message is replaced.


Syntax

SyntaxDescription
EncodeString(string str)Encoder method to convert any string into the byte[] MsgData. Note that the MsgCode is automatically set to ‘0’, which is reserved for string data.

Parameters

NameTypeDescription
strstringThe string to be encoded.

Example

1
2
3
4
5
using Nova.IPC.Pipes;

PipeMessage message = new PipeMessage();
message.EncodeString("Hello!");
Console.WriteLine(message.MsgCode);   // 0
This post is licensed under CC BY 4.0 by the author.

Trending Tags