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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top