Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. _ClientSocket.Send(ASCIIEncoding.ASCII.GetBytes("REGISTER_ME");
  2. _ClientSocket.Send(ASCIIEncoding.ASCII.GetBytes(System.Environment.MachineName));
  3.  
  4. Socket thisSocket = (Socket)AsyncResult.AsyncState;
  5. int Received = thisSocket.EndReceive(AsyncResult);
  6. byte[] DataBuffer = new byte[Received];
  7. Array.Copy(_Buffer, DataBuffer, Received);
  8.  
  9. MessageBox.Show(Encoding.ASCII.GetString(DataBuffer));
  10. if(Encoding.ASCII.GetString(DataBuffer) == "REGISTER_ME")
  11. {
  12. //Here's the problem, I need to find a way to fetch *System.Environment.MachineName* when the command *REGISTER_ME* is requested from the client
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement