RE: System.Byte() array convert to string... HOW???

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 07:15:35 +0100

Jarrod Sharp <JarrodSharp@discussions.microsoft.com> wrote:
> this worked as well.... but geez.... why no GetData(string) ??

Because a socket is a fundamentally binary object. I think it's great
that the framework makes such a clear distinction between binary data
and character data.

Note that you don't need to create a new instance of ASCIIEncoding
yourself - just use the Encoding.ASCII property.

(I'd also suggest using the Socket class that's built into the
framework, btw - or even TcpClient.)

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: COmpact Framework Network Sniffing
    ... the UI with a Compact Framework application. ... code) to capture the packets and forward them, ... //For sniffing the socket to capture the packets has to be a raw ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Nonblocking and/or win32
    ... Add received data to a buffer. ... The framework notify that some data available. ... > something that simply calls a method on the socket of concern. ...
    (comp.lang.ruby)
  • Re: Nonblocking and/or win32
    ... Check to see if there's any data waiting. ... your program cannot have data from the socket. ... If the program use a event driven framework, ... No virus found in this outgoing message. ...
    (comp.lang.ruby)
  • Re: Master/worker design
    ... > 1) I am trying to multiplex text and binary data on the same socket. ... will tell you the number of elements in any string. ... before you can measure and transmit it. ...
    (comp.lang.tcl)
  • Re: Desperately need help in Tcl socket and fileevent puzzle...
    ... > 1) connect to a socket ... > 2) setup a fileevent handler to read binary data coming from this ... fconfigure $channel -translation binary ... You'll want to also make the $binFile channel a binary channel. ...
    (comp.lang.tcl)