networking help 2

  • Thread starter Thread starter lucifer
  • Start date Start date
L

lucifer

CODE
public static void web(Socket suck )
{
byte [] rbuffer =new byte[BUFSIZE+1];
byte [] sbuffer =new byte[BUFSIZE+1];
string str="<HTML><BODY><H1>nweb Web Server
Sorry:</H1></BODY></HTML>\r\n";
sbuffer=str//error can convet
suck.Receive(rbuffer);
suck.Send(sbuffer);//cant send data as only byte array can
be send



}
how can an string be converted to a byte array.
Even convert class is not useful
plz help
 
lucifer,

Check out the Encoding class in the System.Text namespace.
Specifically, you have to decide on which kind of encoding you wish to use.

Hope this helps.
 
Back
Top