Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

msmq C#, not sure how to send receive a byte[]

486 views
Skip to first unread message

Thorsan

unread,
Mar 19, 2003, 8:13:47 AM3/19/03
to
Hi there


Please dont take this as a cross post, but this group looks to me to
be a better place to post my msg, than ms..pub..languages.csharp..

I am trying to send a RSA encoded password, to be used by 3DES on the
other side. The server has the encoded key in a file, so what I want
is to generate the same file on the client side to see if they are the
same, but now such luck yet....


hope someone can help me out, thanks


Ive looked at the msg, and it to me it looks like the byte array sent
is intact..

//Function to send a byte[]
public void sendMessage2(byte[] msg2, string ip, string queName)
{
MessageQueue queUserManFormatTCP = new
MessageQueue("FormatName:DIRECT=TCP:"+ip+"\\private$\\"+queName);
queUserManFormatTCP.Formatter = new BinaryMessageFormatter();
queUserManFormatTCP.Send(msg2);
}


when I receive I use my read msg function

public void receive()
{
//Que declared in class, function finds que reads msg...
byte[] msg ;
que.Formatter = new BinaryMessageFormatter();
msg = que.Receive();


}


Now what do I do with the msg object to so that I can get byte[] msg =
msg; //The msmq msg retreived from the queue

Please help me out guys,,,,
Should I use a different formater or am I on the right track now?


Thanks

Thor Ingham

Doron Juster [MSFT]

unread,
Mar 20, 2003, 11:22:04 AM3/20/03
to
You should be able to do

byte[] myBytes = (byte[])msg.Body;

Just as a suggestion, although BinaryFormatter should work fine,
ActiveXMessageFormatter might give you better performance results.

HTH, Doron
--
This posting is provided "AS IS" with no warranties, and confers no rights.
.

"Thorsan" <ne...@thorsan.net> wrote in message
news:p6rg7vgs0p6mf469r...@4ax.com...

Thorsan

unread,
Mar 24, 2003, 1:14:49 PM3/24/03
to
Thank you very much..


"Doron Juster [MSFT]" <Dor...@Microsoft.com> wrote in message
news:#eq4Yzv7...@TK2MSFTNGP11.phx.gbl...

0 new messages